NSUserDefaults

Discussion in 'iOS Programming' started by Programmer, Jan 6, 2010.

  1. Programmer macrumors member

    Programmer

    Joined:
    Jun 16, 2009
    #1
    In my application i need register my NSUserDefault it had been working fine until now, Could someone please help i don't know what is wrong with this:

    [[NSUserDefaults standardUserDefaults] registerDefaults:mad:"Friend1"];
     
  2. Programmer thread starter macrumors member

    Programmer

    Joined:
    Jun 16, 2009
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    It will help if you learn to use the documentation. If you look up that method in Xcode > Help > Documentation, you'll see that its argument is an NSDictionary, not an NSString. So construct a dictionary of default objects for each preference you have, and then pass it to that method.
     
  4. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
    #4
    Would you mind posting your solution(s)? It might help other developers facing similar issues (although kainjow explained it pretty well).
     

Share This Page