Programmer macrumors member Original poster Jun 16, 2009 79 0 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 8, 2005 1,005 0 London , UK Sep 25, 2009 #2 I wrote I post on this http://objcolumnist.com/2009/06/28/nsuserdefaults-preferences/
Darkroom Guest Dec 15, 2006 2,445 0 Montréal, Canada 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 8, 2005 1,005 0 London , UK 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 Jun 16, 2009 79 0 Sep 25, 2009 #5 but... but how do declare the stuff you want to set as your NSUserdefault
Menge macrumors 6502a Dec 22, 2008 613 7 Amsterdam Sep 25, 2009 #6 MacDonaldsd posted the answer for this very early in this thread... just read.