I have the following ARC enabled code
@property (nonatomic, weak) NSArray *a;
- (void)viewDidLoad
{
[super viewDidLoad];
self.a = @[@1, @2];
NSLog(@"ab is %@", self.a); //prints details of array
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
for (id element in self.a) { //empty here
NSLog(@"blah");
}
// Dispose of any resources that can be recreated.
}
This is the only place where I used the self.a
. This is a test program I wrote to debug one of my issues.
When I simulate memory warning self.a
vanishes? Why?