Reputation: 3043
Hi i want to update data for key but it still stays the same my code is:
NSUserDefaults *userNamePrefs = [NSUserDefaults standardUserDefaults];
[userNamePrefs removeObjectForKey:@"mykey"];
[userNamePrefs setObject:@"myNewStringValue" forKey:@"mykey"];
but it does not works it does not remove object and ignore to add new value for key, please help what am i missing
thanks
Upvotes: 1
Views: 5181
Reputation: 170829
Try calling
[userNamePrefs synchronize];
after you made your updates
Upvotes: 12