how to store NSDictionary in NSUserdefaults and how can I retrieve from it

前端 未结 1 1966
闹比i
闹比i 2020-12-31 08:25

I am getting some info from web server like this.

970,
Aditya2,
B,
JNTU1,
\"Ram@gamil.com\"

I need to store these values and I need to retr

相关标签:
1条回答
  • 2020-12-31 08:54

    To store and then receive:

    [[NSUserDefaults standardUserDefaults] setObject:myDictionary forKey:@"dictionaryKey"];
    //...
    NSDictionary * myDictionary = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"dictionaryKey"];
    

    Here's a link to the NSUserDefaults Class Reference

    0 讨论(0)
提交回复
热议问题