iphone - Does NSUserDefaults delete keys, that are not needed temporarily? -
i'm storing data in nsuserdefaults. i'm trying store keys specific prefix in array. therefore, first load userdefaults in dictionary.
nsstring *myprefix = @"prefix"; nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; nsdictionary *dict = [defaults dictionaryrepresentation]; (nsstring *keywithprefix in dict.keyenumerator) { if ([keywithprefix hasprefix: myprefix]) { [relevantkeys addobject: keywithprefix]; } } the problem is: when print "dict" (which represents userdefaults). there keys missing. nsuserdefaults delete keys, not needed temporarily?
nope not, nsuserdefault persistance storage, please read following answer has explanation how persistent [nsuserdefaults standarduserdefaults]?
Comments
Post a Comment