在启用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
的使用。
https://stackoverflow.com/questions/7205128
复制相似问题