This question looks very straight, However I have a situation here, I just need some help how to do it in efficient way. Say for e.g: I have three views View 1, View 2, View 3.
At First, I pushed View 1 from a base view, then View 2 from View 1, then View 3 from View 2. Now View 3 need an object which is holding the information of a user. So here What I done was pass that user object from base one to View 1, and to view 2 and to view 3 while loading all views, Here every view is storing that object as Ivar even though View 1 and 2 don’t use that.
I don’t think its good to access View 3 directly from base to set the object, Or access base from View 3 to get value, Any idea guys how to handle this kind of situation.
As a beginner, Just I want to clarify this doubts. thanks.
Use singletons to keep information that you need in different classes/views across the application.
Follow this good tutorial if you don’t know how to implement singletons in Objective C.