flo*_*hei 6 cocoa-touch timing uialertview
我遇到了一个问题,UIAlertView
我的应用程序中的所有内容都需要花费很长时间才能显示出来.显示屏立即变暗,但实际警报需要显示5秒钟.
我正在创建它们:
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
Run Code Online (Sandbox Code Playgroud)
谁有过这个?
谢谢
-f
bea*_*lex 12
如果您尝试从主线程显示UIAlertView NOT,您可以看到这种类型的延迟(有时,更严重的错误和崩溃).
将代码作为单独的方法提取并使用"performSelectorOnMainThread"调用它,或者使用GCD并在那里调度它.