forum

Home / DeveloperSection / Forums / What's the nicest way to do observer / observable in objective-c (iphone version)

What's the nicest way to do observer / observable in objective-c (iphone version)

Tarun Kumar177820-Aug-2015

I'm used to coding Java Swing UIs, and in those if you have some properties that change, and you want your UI to update, you would implement the observer/observable pattern. In Java you do this normally by having your class maintain a list of listeners that it notifies of different events.

 

I've played with Objective-C on the Mac, and that has KVC and binding which seems to work very nicely, and requires less code. The iPhone SDK doesn't seem to have this functionality though, so my question is: If I have a class that holds data that changes, what's the best way for me to register a UI component with that class so that it can be notified of changes in the data that it needs to display?


Updated on 20-Aug-2015

Can you answer this question?


Answer

1 Answers

Liked By