I am trying to add an observer to a property of AppDelgate but its not working for some reason, so just wanted to know if i am missing something.
Here's the code i am using:
AppDelegate.h
@property(strong, nonatomic) NSDictionary * dataDict;
AppDelegate.m
-(void)viewDidLoad{
[(AppDelegate *)[[UIApplication sharedApplication] delegate] addObserver:self forKeyPath:@"dataDict" options:0 context:nil];
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
// Do something
}