通常,当在块中使用强引用(保留循环)时,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];
这里有保留周期吗?