I am trying to run the dealloc method for some elements that / were stored in a mutable array but cannot find a way to do this.
I ran into this problem when working in a larger ARC project and found the answer in this post: The dealloc method is not called when the object is set to zero . After reading this answer, I felt that I understood how ARC should process this code (see below), however, after starting in a very simple test project, I get the same results.
In the main view controller, I run the modified array (strong property) and add some other view controllers to it. Then I delete all the objects:
- (void)viewDidLoad{ [super viewDidLoad]; containerArray = [[NSMutableArray alloc]init]; for(int i = 0; i < 10; i++){
In the item view controller:
-(void)dealloc{ NSLog(@"item dealloc"); }
Any help is greatly appreciated.
source share