如题,怎么样在通过属性定义的NSMutableArray中增加对象?
[tapBlockView setTapBlock:^(UIImage* image) {
[self.myImageArray addObject:image]; // 保留周期
}
如果我创建如下的引用:
__weak NSMutableArray *array = self.myImageArray;
[tapBlockView setTapBlock:^(UIImage* image) {
[array addObject:image]; //这种情况怎么更新原始数组?
}
还有:
__weak id weakSelf = self;
[tapBlockView setTapBlock:^(UIImage* image) {
[weakSelf storeImageInaNewMethod:image]; //调用SToreImageInaNewMethod
}
和
-(void)storeImageInaNewMethod:(UIImage*)image {
[self.myImageArray addObject:image]; // 再次保留周期
}
怎么更新通过属性定义的原始对象?