I have a json stored in my app documents folder and I need to use it all over my views. I’m loading and adding the json to a NSMutableArray in each view. But now I learned that I can simple load the array to a NSMutableArray inside the AppDelegate once, and get the information directly from the AppDelegate when I need it.
Is it a bad practice?
I would better use a Singleton for your
JSON storage, thanAppDelegate.So you can use it anywhere in your code like:
and you can add new methods to this class as your project grows
This is an article how to implement singletons in Objective-C