【发布时间】:2013-09-10 10:46:33
【问题描述】:
如何在 viewDidLoad 的后台线程中执行 JSON 解析,并在单击按钮时将其移动到主线程。现在我尝试了
[self performSelectorInBackground:@selector(parseData) withObject:nil];
-(void)parseData {
MSJsonParser *parser = [[MSJsonParser alloc]initWithParserType:kCountriesParsing];
parser._parserSource = self;
[parser requestParsingWithUrl:COUNTRIES_URL ];
}
但我不知道如何将此后台进程更改为主线程。请帮帮我
【问题讨论】:
-
你为什么要这么做?
标签: ios objective-c json background-thread