没有太多判断此代码的设计,我想知道如何解决我创建的保留周期......
@interface BlockClass : NSObject
{
id actualObject;
NSError *actualError;
void (^block)(id, NSError *);
}
@end
@implementation BlockClass
- (id)init
{
self = [super init];
if (self) {
block = ^(id object, NSError *error){
actualObject = object; // Compiler warns: capturing 'self' strongly in this block is likely lead to a retain cycle
actualError = error;
};
}
return self;
}