Programmer macrumors member Original poster Sep 25, 2009 #1 i have been trying to declare an NSUserdefualt in my app for a few hours and i am starting to get really frustrated. How do you set the NSUserdefualt up?
i have been trying to declare an NSUserdefualt in my app for a few hours and i am starting to get really frustrated. How do you set the NSUserdefualt up?
MacDonaldsd macrumors 65816 Sep 25, 2009 #2 I wrote I post on this http://objcolumnist.com/2009/06/28/nsuserdefaults-preferences/
Darkroom Guest Sep 25, 2009 #3 instead of writing something like the following several times in methods throughout a class: Code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; you could simply define it at the beginning of your class: Code: #define kDefaults [NSUserDefaults standardUserDefaults]
instead of writing something like the following several times in methods throughout a class: Code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; you could simply define it at the beginning of your class: Code: #define kDefaults [NSUserDefaults standardUserDefaults]
MacDonaldsd macrumors 65816 Sep 25, 2009 #4 Darkroom said: instead of writing something like the following several times in methods throughout a class: Code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; you could simply define it at the beginning of your class: Code: #define kDefaults [NSUserDefaults standardUserDefaults] Click to expand... True, I don't like using constants like that though 🙂 Personal choice though.
Darkroom said: instead of writing something like the following several times in methods throughout a class: Code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; you could simply define it at the beginning of your class: Code: #define kDefaults [NSUserDefaults standardUserDefaults] Click to expand... True, I don't like using constants like that though 🙂 Personal choice though.
Programmer macrumors member Original poster Sep 25, 2009 #5 but... but how do declare the stuff you want to set as your NSUserdefault
Menge macrumors 6502a Sep 25, 2009 #6 MacDonaldsd posted the answer for this very early in this thread... just read.