Apple の Reachability.h をデモ アプリに実装しました。問題は、接続の確認中にアプリが停止することに気付いたことです。
そこで、 Activity Indicator (From MBProgressHUD ) を追加しました。しかし、インジケーターはアニメーションしません。アプリケーションでも停止します。
そのため、メインスレッドとは異なる別のスレッド内にアクティビティインジケーターを配置することを考えましたが、それでもアニメーション化されていません.
注:私はあまり経験がありません
更新: また、ネイティブのアクティビティ インジケーターを試してみましたが、うまくいきませんでした。
- (void)anotherThread
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.navigationController.view addSubview:HUD];
// Set determinate mode
HUD.mode = MBProgressHUDModeDeterminate;
HUD.delegate = self;
HUD.labelText = @"loading";
// myProgressTask uses the HUD instance to update progress
[HUD showWhileExecuting:@selector(crazyCounter) onTarget:self withObject:nil animated:YES];
[pool release];
}