我有一个非常简单的方法。然而,在UIAlertView中不会运行的方法....这里是我的方法:方法没有运行 - iOS
-(void)post_result {
NSLog(@"Post Result");
post_now.enabled = YES;
[active stopAnimating];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Success" message:@"You're post has been successfully uploaded." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alertView show];
success_post_facebook = 0;
success_post_youtube = 0;
success_post_googleplus = 0;
success_post_tumblr = 0;
success_post_twitter = 0;
NSLog(@"Post Result END");
}
奇怪的是,该代码之前和之后的UIAlertView中会在此方法运行....那么地球是错的??
谢谢你的时间。
调试器中的任何东西?你是否在一个单独的线程中调用这个“post_result”?如果您希望得到一个好的答案,我会发布更多的代码。 –
你是什么意思,它不会运行 - 它不显示? – thegrinner
确保您在主线程中显示警报。 – rmaddy