IPhone : KVO on Local Notifications

on Sunday, February 22, 2015

I'm updating a button based on if I have local notifications set on my iOS app. I'd like to do this with KVO, as there are various ways notifications can be set so I won't be easily able to track when a change is made to the local notifications otherwise.


I'm setting it up like this:



[[UIApplication sharedApplication] addObserver:self
forKeyPath:@"scheduleLocalNotifications"
options:NSKeyValueObservingOptionInitial
context:NULL];


but the problem is, apart from the initial call I'm not getting anything come through into my observer method



- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context


Am I doing something wrong in my addObserver method or is there another way I can be notified of my scheduled local notifications?


0 comments:

Post a Comment