Use NSUserDefaults . Actually easy to use and accessed anywhere in the application.
You must use it to store user settings. It can store simple data types, as well as complex objects and even arrays, dictionaries. To store any key will be easier than
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:firstName forKey:@"firstName"];
And after reading it,
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *firstName = [defaults objectForKey:@"firstName"];
Note Custom defaults are stored in the plist file and loaded each time the application starts. Therefore, be careful not to write too much information into it. Otherwise, the application load time increases, and if it goes beyond the watchdog timer, the application will receive SIGKILL and crash.
But in your case, you can use this to store user settings.
Hope this helps!
source share