I am saving app preferences using [NSUserDefaults standardUserDefaults], inside it there are a few items, one of which is an array filled with dictionaries. I want to delete first item in that array, so I try something like:
[[[NSUserDefaults standardUserDefaults] objectForKey:accounts] removeObjectAtIndex:0];
this does remove array item at index 0, but it doesn’t update the plist file. But, when I do
[[NSUserDefaults standardUserDefaults] removeObjectForKey:accounts];
it removes all items AND updates the plist file. Why doesn’t the first line save data to plist?
Try this.