Storing custom objects in an NSMutableArray in NSUserDefaults

后端 未结 5 1669
情深已故
情深已故 2020-11-22 16:11

I\'ve recently been trying to store the search results of my iPhone app in the NSUserDefaults collection. I also use this to save user registration info successfully, but fo

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 16:38

    I think it looks like the problem with your code is not saving the results array. Its loading the data try using

    lastResults = [prefs arrayForKey:@"lastResults"];
    

    This will return the array specified by the key.

提交回复
热议问题