I'm using appDelegate for sharing NSMutableArray but it's crashing. Error message is:
unrecognized selector sent to instance
My code is:
countrydata *countryobj=(countrydata *)[listItems objectAtIndex:indexPath.row];
if(addItems==nil)
{
addItems=[[NSMutableArray alloc]init];
}
[addItems addObject:countryobj];
callAppDelegate *appDelegate = (callAppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.AddItems=addItems;
[self dismissModalViewControllerAnimated:YES];
Where is my code is wrong? appdelegate.AddItems is NSMutableArray and already declare in callAppDelegate.h. I already import callAppDelegate.h in top.