I have a question about sharing data between views, hopefully it's not too basic. I have an NSMutableArray in an appDelegate with say (Object1, Object2, Object3). When a new Object is created (and added to the array), I need to access that Object on the next view. Previously I was just passing the Object to the next view, but that got messy and seemed wrong.
So now I have all my objects in one place, but how can I access the Object (that was just created) in the next view because I don't know what index it was added into? Do I need to check the count of the array each time I create an object, then determine the array index from that and pass that index value to the next view? Or is there a way to retrieve objects from a NSMutable array by a unique name of some sort?
Another solution would be to iterate over all of the Objects until I find the one that I want, but I'm wondering what is the right way to do this. Thank you for your time.
Edit: Thanks for the response, I'll clarify what I'm trying to do. I have a NavigationController and each view that you go into needs access to the Object. You could think about it like a book. The first view you select the book you want to read, and then each view thereafter is a page from the book you selected. And in the App Delegate is the array of all the books. Would you pass each "Page" view the book?
Keep in mind this is kind of a rough example because when you select the book you would already know the index that it was at. Say if you create a book, then you don't know where in the array it is at yet.