iphone - Alertview中的Exc_Bad_Access显示

标签 iphone objective-c xcode crash exc-bad-access

在UIAlertView显示消息中获取Exc_Bad_Access。

UIAlertView *systemAlert1 = [[UIAlertView alloc]initWithTitle:@"System message" message:@"note" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [systemAlert1 show];  **//Crashing on this line [EXC_BAD_ACCESS]**
    [systemAlert1 release]; 

为什么我得到这个?请帮忙

最佳答案

任何UI内容,包括警报显示,都应在主线程上完成。
如果在其他线程上执行此操作,则肯定会崩溃。

关于iphone - Alertview中的Exc_Bad_Access显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13084014/

相关文章:

iphone - 每个对象有多个委托(delegate)?

iphone - 顶部带有圆角的 UIButton

iphone - 主屏幕引导至 TabBar Controller

xcode - 'Jenkins' 用户未在 OS X 安装上创建

iphone - iPhone 版 MPMoviePlayerController 中的隐藏式字幕

iPhone - 在 UITextfield 下方显示错误消息的最佳方式是什么

objective-c - 如何释放CGColorRef?

ios - 游戏在检查 Sprite 时偶尔会崩溃

objective-c - 如何在 Objective-C 中增加 NSDate 对象

objective-c - 为什么此代码在使用 Apple LLVM 编译时会崩溃,但在 LLVM/GCC 中不会崩溃?