ARC使用完成处理程序保留循环

时间:2014-12-11 08:03:45

标签: ios objective-c ios7 automatic-ref-counting objective-c-blocks

如何在以下代码中修复ARC保留周期?

-(void) processRequest:delegate:(id<Delegate>)delegate {

__block  Request * request;
request = [[Request alloc] completionHandler:^(Response * response){

    [delegate removeCachedRequest:request];

    if (completionHandler)
    {
        completionHandler(response);
    }

}];

}

0 个答案:

没有答案