ARC 対応のコードで、ブロックベースの API を使用している場合、保持サイクルの可能性に関する警告を修正する方法は?
警告:
Capturing 'request' strongly in this block is likely to lead to a retain cycle
このコード スニペットによって生成されます。
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:...
[request setCompletionBlock:^{
NSDictionary *jsonDictionary = [[CJSONDeserializer deserializer] deserialize:request.rawResponseData error:nil];
// ...
}];
警告はrequest
、ブロック内のオブジェクトの使用にリンクされています。