I am using an NSTimer running every second to load a string in a label that the user sees from NSUserdefults. When the user picks from a UITableView a string, this string is saved in the userdefaults, and the timer running every second updates the label with the user’s choice. is there a way to ckeck if a value in the NSUserdefults has changed without using a timer?
I am using an NSTimer running every second to load a string in a
Share
Unless the app’s user defaults are modified by another app (an unlikely occurrence, and I’m not even sure if that’s possible on iOS), your app should know when the value changes. If it happens in a background thread, you can use
NSNotificationandNSNotificationCenterto alert other components of your app that the value has changed.