The objects that appear in the window with the file owner, the first responder, represent top-level objects. Everything that you add to the view will be subordinate - all sub-items are saved by direct control, so they do not need to be stored elsewhere. The view itself is saved by the view controller, so it does not need to be saved.
If you add non-display objects or views that you don’t place directly in your main view (for example, toolbar buttons that are not currently displayed), you need to save them or they will be released. My preferred method for this is with IBOutlets using @property, for example:
@property(nonatomic, retain) IBOutlet UIBarButtonItem * myButton;
This calls -setMyButton: to call the owner of the file (if this code belongs to the file), and the object connected via IB is sent to save in this property.
Alex gosselin
source share