What is the proper way to add objects in NSMutableArray which is strongly defined by property.
[tapBlockView setTapBlock:^(UIImage* image) {
[self.myImageArray addObject:image]; // self retain cycle
}
If I will create weak reference something like
__weak NSMutableArray *array = self.myImageArray;
[tapBlockView setTapBlock:^(UIImage* image) {
[array addObject:image]; // If I will do this then how will I update original Array ?
}
I have also tried
__weak id weakSelf = self;
[tapBlockView setTapBlock:^(UIImage* image) {
[weakSelf storeImageInaNewMethod:image]; // Calling SToreImageInaNewMethod
}
and
-(void)storeImageInaNewMethod:(UIImage*)image {
[self.myImageArray addObject:image]; // This again retaining cycle
}
What is the proper way to update original object defined by property ?