iphone - Detecting changed user defaults -


i have iphone app , have implemented local notifications. app has page in settings allows user schedule notifications specified number of days in advance of event. make sure changes settings take effect every time user activates app, have following in app delegate:

- (void)applicationdidbecomeactive:(uiapplication *)application {     [[nsuserdefaults standarduserdefaults] synchronize];     [self rescheduleallnotificationswithusernotification:no]; } 

the problem call rescheduleallnotificationswithusernotification: takes few seconds , app feels little sluggish on start.

i need call rescheduleallnotificationswithusernotification: if of settings have been changed. is there way detect if user has changed of settings between app activations can avoid rescheduling notifications?

i think might looking nsuserdefaultsdidchangenotification notification.

you can register listen notification , informed whenever user's preferences change.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -