Resetting the values of NSUserDefaults

Discussion in 'iOS Development' started by johnmabassa, Jun 15, 2009.

  1. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
    Hi,

    How can I reset the values which are present in NSUserDefaults? I tried using
    Code:
    [NSUserDEfaults resetStandardUserDefaults];
    but it is not working, the values already set are still coming even after clean build.Any idea how to do it?

    -John
  2. bamhm182

    bamhm182 Member

    Joined:
    Mar 2, 2009
    Messages:
    544
    Likes Received:
    0
    Device:
    3G iPod touch
    If I were doing it, I would reset them 1 at a time, I'm sure there is an better way to do it though.

    EDIT: Nevermind, looks like resetStandardUserDefaults is correct. Did you copy that directly from your code? Make sure in your code that it is NSUserDefaults, not NSUserDEfaults.
  3. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
    This is for some testing purpose..... I want to reset all the values and there is no typo error.... I just typed it out. I am calling that inside applicationDidfinishLaunching method but nothing happens. Currently I am uninstalling the app from simulator each time and installing it as new.

    -John

Share This Page