objective c - Signaling options change in iOS -
in first "real" ios application, want push options view , signal main controller if options changed. main controller creates options object , passes option view controller, may change properties; question how alert main controller of changes. come several ways this, seems common thing there must standard design pattern, , haven't been able find it. recommendations?
handling changes, actions, or user interaction in other views essential use case of delegates. best practice have first view controller delegate of options controller, , user chooses 1 of options, calls methods on delegate notify of final choice. in response delegate calls reload table view, disable/enable buttons, or other updates need do.
other options keeping values/state in sync between views are:
- core data - best used data
- key-value observation - best used data
nsnotification
s sent throughnsnotificationcenter
- best used actions
Comments
Post a Comment