How to delete a user default value in NSUserDefaults?

HelloMoon picture HelloMoon · Aug 27, 2009 · Viewed 69.5k times · Source

I.e., my app sets some standard default values at the beginning. Then those values may get overridden by the user. And when the user messes things up, I want to set those settings back to my app default values. As I understand it, the app defaults are a different dictionary than the user defaults, and the user defaults just override those app defaults. But I haven't seen methods for deleting the user defaults. Any idea?

Answer

fbrereto picture fbrereto · Aug 27, 2009

Try removeObjectForKey -- that should give you the ability to remove a preference.