这是我的代码:
#ifdef DEBUG
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ERROR" message:@"JSON Parsing Error" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
#endif
Run Code Online (Sandbox Code Playgroud)
此代码在后台线程中执行(负责解析),并且错误仅在每隔一次发生.有什么问题在这里有什么想法吗?
我有这个代码:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
Run Code Online (Sandbox Code Playgroud)
问题是这个代码在显示警报之前崩溃了,我已经在较低的iOS上测试了它并且它可以工作但是在iOS 6上崩溃了.