在下面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 –