如果通过AFHTTPOperation和OperationQueue进行更新,我有一个UIViewController可以下载多个文件。如果由于某种原因,用户按下电源按钮,并且应用程序在下载这些文件时进入后台,我想要退回或放到前一个屏幕。在执行此操作之前,我正在取消下载队列中的所有当前操作。当应用程序进入后台时执行Segue
下载的UIViewController
- (void)didEnterBackground:(NSNotification *)notification {
if ([_downloadsQueue operationCount] > 0) {
[_downloadsQueue cancelAllOperations];
}
[self performSegueWithIdentifier:@"unwindToLogin" sender:self];
}
登录的UIViewController
- (IBAction)unwindToLogin:(UIStoryboardSegue *)segue {
_passwordTextField.text = @"";
_userNameTextField.text = @"";
_files = [[NSMutableArray alloc] init];
}
目前,在重新进入到应用中我看到了下载屏幕上短暂之前我看到的登录屏幕。无论如何要阻止这种情况发生?
如果您关闭该segue的动画,会发生这种情况吗? –
我不知道如何关闭动画放松继续。我会在上面发布我的segue的代码。 –