Cocoa - Store an NSString value
cocoa, save, storage, xcode
Solution
NSUserDefaults is what you're looking for.
Save string:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setObject:theStringToSave forKey:@"keyToLookupString"];
[prefs synchronize];
Retrieve string:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *theSavedString = [prefs stringForKey:@"keyToLookupString"];
Problem
I want to store an NSString variable, that I receive from a JSON request, for future use. So when the user loads the app again, it loads that value (an NSString) that I stored. What is the best way to store that kind of information?