サーバーから画像を非同期でダウンロードしようとしています。画像をダウンロードして配置した後、画像を含む画像ビューを使用して、アプリを次のビュー コントローラーに移動させます。これが私のコードです:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://...../.png"]] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[NSURLConnection sendAsynchronousRequest:request queue:queue
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
if ( !error ) {
image = [[UIImage alloc] initWithData:data];
if (image != NULL) {
[self performSegueWithIdentifier:@"midnight" sender:self];
}
}
NSLog(@"%@", image);
}];
}
問題は、次のView Controllerが約10〜15秒間何も表示されず、View Controllerに表示されるはずの画像とテキストが表示されることです。ここで私が間違っていることはありますか?