In ARC enabled code, how to fix a warning about a potential retain cycle, when using a block-based API?
The warning:
Capturing 'request' strongly in this block is likely to lead to a retain cycle
produced by this snippet of code:
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:...
[request setCompletionBlock:^{
NSDictionary *jsonDictionary = [[CJSONDeserializer deserializer] deserialize:request.rawResponseData error:nil];
// ...
}];
Warning is linked to the use of the object request
inside the block.