Alertview中的Exc_Bad_Access显示 [英] Exc_Bad_Access in alertview show

查看:59
本文介绍了Alertview中的Exc_Bad_Access显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在UIAlertView显示消息中获取Exc_Bad_Access。

Getting Exc_Bad_Access in UIAlertView show message.

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]; 

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

Why i am getting this?? Please help

推荐答案

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

ANY UI stuff including the showing of alerts should be done on Main thread. If you are doing this on some other thread, it will definitely crash.

这篇关于Alertview中的Exc_Bad_Access显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆