我在UIAlertview
里面使用了一个活动指示器。viewdidload()
但是我尝试在延迟后将其从超级视图中删除,但是在UIAlertview
使用以下代码删除后,我无法在应用程序中执行任何操作。就像一个新的透明层仍在我的上方运行看法。
代码
-(void)startAlertActivity
{
_alertView = [[UIAlertView alloc] initWithTitle:@"Loading "
message:@"\n"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil];
spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.center = CGPointMake(139.5, 75.5); // .5 so it doesn't blur
[_alertView addSubview:spinner];
[spinner startAnimating];
[_alertView show];
[_alertView performSelector:@selector(stopAlertActivity) withObject:self afterDelay:5.0];
}
-(void)stopAlertActivity
{ [spinner stopAnimating];
[_alertView dismissWithClickedButtonIndex:0 animated:YES];
}
它看起来像一个仍在屏幕上运行的透明层,我该如何关闭它?
示例图像....
对我来说,警报现在不在屏幕上,但背景是浅蓝色的
崩溃报告
[UIAlertView stopAlertActivity]: unrecognized selector sent to instance 0x9ab5eb0
2013-08-02 12:20:43.822 AssamKart[5719:12203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIAlertView stopAlertActivity]: unrecognized selector sent to instance 0x9ab5eb0'
*** First throw call stack: