I would like to add observer in my UIViewController for property in my application delegate.
is it possible like below code?
myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate] ;
[self addObserver:self
forKeyPath:appDelegate.currentLocation
options:0
context:nil];
the issue it expect the value for “forKeyPath” to be NSString.
1 Answer