活动指示器未启动视图控制器导航到另一个视图控制器时的动画

Vig*_*abu 2 iphone uinavigationcontroller uiactivityindicatorview

我现在在推送另一个视图控制器之前启动活动指示器,但它没有开始为活动指示器设置动画.

[activityindicator startanimating];

[self.navigationcontroller pushviewcontroller:viewcontroller animated:YES];

[activityindicator stopanimating];
Run Code Online (Sandbox Code Playgroud)

Nit*_*ish 10


创建NSThread作为调用选择器,如下所示:

[NSThread detachNewThreadSelector:@selector(threadStartAnimating:) toTarget:self withObject:nil];  
// Some code  
[spinner stopAnimating];  
[self.navigationcontroller pushviewcontroller:viewcontroller animated:YES];  
Run Code Online (Sandbox Code Playgroud)

threadStartAnimating:

-(void)threadStartAnimating:(id)data  
{  
[spinner startAnimating];  
}  
Run Code Online (Sandbox Code Playgroud)