I have a shared singleton that contains all relevant information on the current user and its session, through the object [IWSession session]
and [IWSession session].currentUser
.
The current user (which actually refers to the one logged in the application) might have some of its properties updated frequently through webservice calls (triggered by iBeacon, triggered by a change in its location, etc). This implies to update the GUI accordingly at different places in the app, let's say 5 or 6 class instances.
What's the proper way to update information displayed in the app as soon as any property is updated ?
I thought about
1) Adding a KVO on the [IWSession session].currentUser
on himself and for all properties regarding the following link
Key Value Observing - how to observe all the properties of an object?
2) The KVO would then trigger a
[[NSNotificationCenter defaultCenter] postNotificationName:@"userUpdated" object:nil];
and all classes which need their layout to be updated would listen to that notification.
Is it a good approach ? Any other suggestion ?