I'm starting to get into the inner sanctum of NSUserDefaults to the point where I can now successfully intercept an NSUserDefaultsDidChangeNotification notification using a supplied selector plus NSNotification object as a parameter. However, the returned NSNotification object does not appear as I had expected.
What I was expecting was:
1) Receive NSUserDefaultsDidChangeNotification from the notification centre.
2) Interrogate the returned supplied NSNotification object for user info containing at least one key/value pair with key="While you were asleep the following defaults changed" and object="NSArray of application keys that have taken new values."
What I get is:
1) As above
2) UserInfo=nil! (Anyone know why....?)
My app delegate is the registered respondent to NSUserDefaultsDidChangeNotification and will therefore distribute the changes down to whichever objects need to know about their settings being different. Before I start writing my own code to detect which keys have been affected by a change in user defaults, can anyone advise me; (a) Does one have to determine which changes have occurred one'sself - or am I missing something incredibly obvious? (b) Can anyone point me at some documentation (other than the dev docs!) which gives examples of how to handle NSUserDefaultsDidChangeNotification in an Apple-approved manner? I'm keen not to re-invent the wheel if possible. I've dumped out the dictionaryRepresentation of the returned NSNotification object - but that, obviously, contains all of Apple's own keys/values as well. Thanks, again, in advance. V.V.