非同期 URL リクエストを実行しようとしています:
NSURLRequest* request=[NSURLRequest requestWithURL: [NSURL URLWithString: @"http://www.youtube.com/"]];
NSOperation* operation=[NSOperation new];
NSOperationQueue* queue=[NSOperationQueue new];
[operation setCompletionBlock: ^()
{
}];
[queue addOperation: operation];
[NSURLConnection sendAsynchronousRequest: request queue: queue completionHandler: ^(NSURLResponse* response, NSData* data, NSError* error)
{
NSLog(@"%@",[data bytes]);
}];
したがって、URL に含まれるデータが必要なだけですが、数秒後 (おそらく新しく作成されたスレッドがデータをロードするとき)、アプリケーションがクラッシュします。
thread 6 : EXC_BAD_ACCESS (code=13, address=0x0)
正確なポイントは、データバイトを印刷しようとしたときの NSLog 行の objc_msgSend_vtable5 です。PS: ARC を使用しています。