UIAlertView Loading インジケーターの次のコードがありますが、これは機能せず、私に与えてくれます
- (void) launchActivity
{
//some logic...
[NSThread detachNewThreadSelector:@selector(updateFilterProgress) toTarget:self withObject:nil];
}
- (void) updateFilterProgress {
if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN))
{
UIAlertView *myAlert = [[[UIAlertView alloc] initWithTitle:@"No Internet Connectivity" message:@"This app require an internet connection via WiFi or cellular network to work." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] autorelease];
[myAlert show];
}
else{
UIAlertView *alertMe = [[[UIAlertView alloc] initWithTitle:@"Loading..." message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles: nil] autorelease] ;
//tried this way by placing below line....no result
[alertMe performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:YES];
//[alertMe show];
//some logic...
}
更新: メイン スレッドで、Web サービスを呼び出してデータを読み込んでいます。したがって、UIAlertView の読み込み用に別のスレッドを用意しましたが、iOS 4,5 で動作していました。しかし、iOS 6 でクラッシュします。AlerView をメイン スレッドに配置している場合、ロード中に何も表示されませんが、データがロードされた後、AlertView にはロード インジケータが数秒間表示されます。なにか提案を...