2

What is the equivalent of key-value observing in Android?

Is there something like addObserver:forKeyPath:options:context: in iphone?

Behlül
  • 3,412
  • 2
  • 29
  • 46
  • What does key-value do in iphone? Are they similar to sharedpreferences? – nandeesh Aug 31 '12 at 05:20
  • Nope, it's a mechanism where properties of objects can be registered to listen. It's not limited to `sharedPreferences`. It's a general system for all objects. Main usage area is listening to model changes in the UI. – Behlül Aug 31 '12 at 07:02
  • 1
    I dont think such a unified listener exists – nandeesh Aug 31 '12 at 07:03

1 Answers1

0

If what you are trying to do is detect if a shared preference has changed you might want to take a look at this SO question which seems to address what you are after.

If not you might want to elaborate on exactly what you are trying to accomplish

Community
  • 1
  • 1
Idistic
  • 6,281
  • 2
  • 28
  • 38