这是我的代码:
#ifdef DEBUG
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ERROR" message:@"JSON Parsing Error" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
#endif
这段代码在后台线程中执行(负责解析),并且错误仅每隔一段时间发生一次。知道这里有什么问题吗?
不要从后台线程弄乱 UI。创建一个方法并在主线程上调用该方法:
[someObject performSelectorOnMainThread:@selector(showDebug:)
withObject:@"JSON Parsing Error"
waitUntilDone:YES];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)