Skip to content

New Request - Update View after location has been retrieved #6

@hyarlagadda

Description

@hyarlagadda

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions