Im thinking a program that has made up by navigation bar with multiple views. so basically I want to access data(& storing data) to one same object class through the whole stack of navigation. for example, 1. choose a picture from firstview, store the picture to the object class. 2. change to other view and access the picture from the smae object class. 3. as a next step on the other view, also can access and store the data to this object class.
what I want to know now is how to maintain and access the same file from the all different levels of the program. please give me some tips!
You can make the
UIImageViewor otherNSObjecta property of therootViewController, and then access it by:However, if what you’re passing is an
NSArrayorBOOLorfloatorint, then you can also consider usingNSUserDefaultsto save and load from anywhere within the app.