アクティビティインジケーターがコードでアニメーション化されません。次のコードがあります
どうすれば修正できますか?平均スレッドがインジケーターのステータスを更新しないためですか?もしそうなら、どうすればそれを修正できますか?
@interface ConnectionEstablishedViewController : UIViewController{
IBOutlet UIActivityIndicatorView * activityView;
IBOutlet UILabel *loadingLabel;
}
@property(nonatomic,retain) UIActivityIndicatorView * activityView;
my.xibファイルにラベルとアクティビティインジケーターの両方を割り当てました
.m
- (void) threadStartAnimating {
[activityView startAnimating];
loadingLabel.hidden=YES;
}
- (void) threadStopAnimating {
[activityView startAnimating];
loadingLabel.hidden=NO;
}
-(void)viewDidAppear:(BOOL)animated{
[self threadStartAnimating];
[NSThread sleepForTimeInterval:3.0];
[self hunttable];//call hunttable in order to fetch hunt table data
[NSThread sleepForTimeInterval:3.0];//sleep to prevent thread from overlap
[self huntingarea];
[NSThread sleepForTimeInterval:3.0];
[self stands];
[NSThread sleepForTimeInterval:3.0];
[self weapons];
[NSThread sleepForTimeInterval:3.0];
[self backpack];
[NSThread sleepForTimeInterval:3.0];
[self descriptionget];
[NSThread sleepForTimeInterval:3.0];
[self threadStopAnimating];
}