【发布时间】:2013-11-15 09:57:01
【问题描述】:
通常,当在块中使用强引用(保留循环)时,Xcode 会显示警告。但是,我不明白为什么这个AFNetworking 示例没有显示它。
UIImageView *imageView;
AFHTTPRequestOperation *operation = [apiQueryManager HTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *operation, NSData *responseObject) {
UIImage *image = [UIImage imageWithData:responseObject];
imageView.image =image; // <--- using strong ref to imageView ?
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"ERROR: %@", error);
}];
[apiQueryManager enqueueHTTPRequestOperation:operation];
这里有保留循环吗?
【问题讨论】:
标签: ios objective-c xcode objective-c-blocks retain-cycle