ユーザーが入力した資格情報がバックエンドシステムで検証されるログインモジュールを構築しています。非同期呼び出しを使用して資格情報を検証しています。ユーザーが認証されたら、メソッドを使用して次の画面に進みますpresentViewController:animated:completion
。問題は、presentViewController
メソッドの起動に次の画面が表示されるまでに時間がかかることです。私の以前の呼び出しは、sendAsynchronousRequest:request queue:queue completionHandler:
どういうわけか副作用を引き起こしているのではないかと心配しています。
念のために言っておきますが、4〜6秒は、コマンドpresentViewController:animated:completion
が開始されてからです。コードをデバッグし、メソッドが呼び出された瞬間を監視しているためです。
最初に:NSURLConnection
メソッドが呼び出されます:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
2番目:UIViewController
メソッドは異常な時間をかけて実行されていると呼ばれます
UIViewController *firstViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"FirstView"];
[self presentViewController:firstViewController animated:YES completion:nil];
どんな助けでも大歓迎です。
ありがとう、マルコス。