Is there a way for me to "walk" through a list of all the NSUserDefault
s in my iPhone app, and only delete certain ones?
For example, I'd like to get all the key names that start with a certain word.
Something like this:
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"Dog*"];
i Got solution for this just use it where you want to remove all sessions
it will work
You can look through the
dictionaryRepresentation
.Here's an implementation which uses
NSPredicate
as a generic matcher for greater flexibility.Usage: