私はJSONTouchとJSONの直列化復元を行っておりますよ、それは時間がかかりすぎだし、それがUIをブロックしていますので、私は、バックグラウンドスレッドでシリアライズを置くためにGCDの背景キューを作成しようとしました。時にはそれは細かい動作しますが、時々私はdeserializeAsDictionary:weakSelf.mutableData error:&theError];
にEXC_BAD_ACCESSを取得します。解析JSON :?
私は理由として途方に暮れてよ。私はmutableDataをアトミックプロパティにしました。私は一度に3つのリクエストを作成していますので、mutableDataにアクセスしようとしているスレッドと何か関係がありますか?またはおそらくmutableDataはブロックが実行されているときに良好な状態にありませんか?
ありがとうございます!
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
__weak myViewController *weakSelf = self;
dispatch_queue_t updateQueue = dispatch_queue_create("parse json", NULL);
dispatch_async(updateQueue, ^{
NSError *theError = nil;
// This is the call that gives me EXC_BAD_ACCESS
NSDictionary *dict = [[CJSONDeserializer deserializer]
deserializeAsDictionary:weakSelf.mutableData error:&theError];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf setMutableData: nil];
});
});
dispatch_release(updateQueue);
}