我正在打开一个通过XML加载更新的ModelViewController。
在ViewController.m中
LoadUpdatesView *luv = [[LoadUpdatesView alloc] initWithNibName:@"LoadUpdatesView" bundle:nil];
luv.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:luv animated:YES];在LoadUpdatesView.m中
- (void)viewDidLoad {
[self xmlloadUpdates];
}xmlloadUpdates
- (void) xmlloadUpdates {
statusmessage.text = @"Start loading Updates";
NSString * path = @"xxx.xml";
[self parseXMLFileAtURL:path];
for(int iX = 0; iX < [stories count]; iX++) {
statusmessage.text = @"Loading %@ of %@ entries",iX,[stories count];
}
}但是,只有在xmlloadUpdates通过xml加载完更新之后,才会显示模式窗口。但是,我希望先显示模式窗口,然后开始执行XML内容(xmlloadupdate在模式窗口上显示状态消息)
发布于 2012-09-15 22:11:49
尝试使用线程。阅读并发编程指南: Dispatch,此处:http://developer.apple.com/library/ios/#documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationQueues/OperationQueues.html
https://stackoverflow.com/questions/12438059
复制相似问题