I read a few similar topics, but I seem to be unable to figure it out - sorry. I have a project with several views, including a ViewController, several “under” views, and a NavigationController. I would like to have an array accessible from any of the views, so that I can populate a TableView or TextField, etc. I would like the array to be modifiable from any view that can access it.
Now I have this in the xxAppDelegate.h file:
NSMutableArray *listOfHeadings;
@property (strong,nonatomic) NSMutableArray *listOfHeadings;
And in the xxAppDelegate.m file, I populate the array:
listOfHeadings = [[NSMutableArray alloc] init];
[listOfHeadings addObject:@"Heading 0"]
[listOfHeadings addObject:@"Heading 1"]
But I can not access the array from other .m files. How to do it right?
source
share