With ARC enabled I have a property
@property (strong, nonatomic) NSMutableArray *arr;
I Allocate it as
self.arr = [NSMutableArray array];
I have a custom object ERSearchView, I allocate it and add it to the arr
ERSearchView *SV = [[ERSearchView alloc] initWithDelegate:nil];
[arr addObject:SV];
In my search view I have overridden the dealloc
method, because it seems that the search view isn't getting released:
- (void)dealloc {
self.delegate = nil;
NSLog(@"deallocated search view");
}
This isn't getting called when I pop my view controller. But if I nil the arr variable in the view controller's dealloc
I see the log message that the search view has been deleted.
Can anyone explain how is this possible that objects inside arr
aren't getting released though the view controller is 100% released since I have "did dealloc" message in its dealloc
?