在启用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块内对象的使用有关。
陪伴而非守候
翻翻过去那场雪
慕斯王