这是我的
代码:
#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];
原文链接:https://www.f2er.com/iOS/329182.html