Re: Using UserDefaults properly
Re: Using UserDefaults properly
- Subject: Re: Using UserDefaults properly
- From: Conor Dearden <email@hidden>
- Date: Sat, 09 Sep 2006 11:16:20 +0200
It's all a matter of preferences.
I disagree with storing such simple information in a separate file in the
application support folder. What you have implemented storing the possible
values of the categories for expenses in the preference file is a perfect
use of user defaults. Just because a preference is not visible in the
preference panel does not mean it shouldn't go in the preference file. The
application support folder makes since if the list were much larger and it
was information you rarely need to load, as you could read the file only
when needed. A list of about 50 items will only be ~2,000 bytes (2KB) not
very large at all. However, for such small things you should not consider
speed as a reason to go with one implementation rather than the other. One
reason to store this information outside the preference file is to let users
remove their preferences without losing the category information (Sometimes
a loot of tweaking and careful planning goes into creating these list). It
becomes a question of how essential are these categories. As with most
things there is a grey zone as well. You can store them in a separate
preference file com.yourapp.categories.plist and still use the user default
system that you are familiar with:
file:///Developer/ADC Reference Library/documentation/Cocoa/Reference/Fo
undation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/o
cc/instm/NSUserDefaults/setPersistentDomain:forName:
Conor
http://www.bruji.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden