I am trying to update the view as soon as the location has been retrieved. I added the below code in viewDidLoad method of my UIViewController.
[ [LocationShareModel sharedModel] addObserver:self forKeyPath:@"myLocationArray" options:NSKeyValueObservingOptionNew context:nil];
and added below code in my UIViewController for receiving the update.
-(void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ( [keyPath isEqualToString:@"myLocationArray"] ) {
NSLog(@"changedValues: %@", change);
NSLog(@"Received value");
}
The observerValueForkeyPath is not being called.
Highly appreciate your help in this.