我想在其他线程(不是主线程)中解析一些数据
for (NSString* theKey in [rssSourcesData allKeys])
{
NSURL *url = [NSURL URLWithString:theKey];
NSURLRequest *initialRequest = [NSURLRequest requestWithURL:url];
AFGDataXMLRequestOperation *oper = [AFGDataXMLRequestOperation
XMLDocumentRequestOperationWithRequest:initialRequest
success:^(NSURLRequest *request, NSHTTPURLResponse *response, GDataXMLDocument *XMLDocument) {
[self parseDataInBackground:XMLDocument forKey:theKey];
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, GDataXMLDocument *XMLDocument) {
NSLog(@"failure handler: %@",theKey);
}];
[oper start];
}
在完成解析其他线程中的所有数据后,我想返回主线程。怎么做 ?