I have created the one mutable array in appdelegate. I am trying to retrieve values of that mutable array in another app. But it is crashing at that point. Below is the code I have declared in appdelegate:
savedLocation = [[NSMutableArray alloc] init];
savedLocation = [[NSMutableArray arrayWithObjects:
[NSNumber numberWithInteger:0],
nil] retain];
Below is code in which I am trying to access the array values in another application through appdelegate:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSInteger selection = [[appDelegate.savedLocation objectAtIndex:0] integerValue];
But it is crashing at:
NSInteger selection = [[appDelegate.savedLocation objectAtIndex:0] integerValue];
Please tell me the reason why it is crashing and the correct way of doing this also.