在下面UIAlertView
示例代碼延遲之後表演,但我需要馬上顯示出來爲什麼我的UIAlertView只會在延遲後出現?
//metoda zapisuje komentrz na serwerze
-(void) saveAction {
UIAlertView *progressAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"imageGalleries.sendAction", @"") message:@" " delegate:self cancelButtonTitle:NSLocalizedString(@"alert.cancel", @"") otherButtonTitles:nil];
[progressAlert addSubview:progressView];
[progressAlert show];
// some long performance instructions
}
- (void)loadView {
[super loadView];
self.navigationItem.rightBarButtonItem = [NavButton buttonWithTitle:NSLocalizedString(@"sendImage.saveButtonTitle", @"") target:self action:@selector(saveAction)];
progressView = [[UIProgressView alloc] initWithFrame: CGRectMake(30.0f, 80.0f - 26, 225.0f, 10.0f)];
}
爲什麼UIAlertView
不會立即顯示當我打電話saveAction
?
我的觀點正是如此。在後臺執行長時間的操作。通知UI的進展。警報將立即顯示並且操作可以繼續不受阻礙。 +1 –