0

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 の処理を​​開始したい (xmlloadupdates はモーダル ウィンドウにステータス メッセージを表示する)。

4

1 に答える 1

1

スレッドで試してください。コンカレンシー プログラミング ガイド: ディスパッチ キューについては、こちらをご覧ください: http://developer.apple.com/library/ios/#documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationQueues/OperationQueues.html

于 2012-09-15T14:11:48.753 に答える