Re: Using UserDefaults properly
Re: Using UserDefaults properly
- Subject: Re: Using UserDefaults properly
- From: Andrew Merenbach <email@hidden>
- Date: Fri, 8 Sep 2006 20:33:18 -0700
Hi, Keith. What you have is definitely not a preferences issue, but
you absolutely, under no circumstances, want to write to your
application's own package. You also won't want to go around making
invisible files--a user needs to be able to uninstall a program fully
and entirely without needing to futz around with Terminal.
There is a solution, however. What It sounds as though you want to
do is to put something in the ~/Library/Application Support folder,
which is designed for this sort of thing. (There was a post
recently, which you should examine, about finding the path to this
directory without hard-coding it.)
Cheers,
Andrew
On 8 Sep 2006, at 20:23, Keith Penrod wrote:
I'm writing a basic program to keep track of your budget, and as
part of that I want to have a list of categories (like Car
expenses, Groceries, etc.) that the user can define and modify.
But, since the user wouldn't want to re-enter this list of
categories each time a new document is created, I would like to
store the list of categories somewhere "shared." What I have done--
that works--is just store an NSDictionary with the information in
the standardUserDefaults, using NSUserDefaults. However, since
this isn't technically a "prefence" kind of thing, I don't think
that's where I should store it. Would there be a better way? I
mean, I wouldn't want to create a file that's outside of the
packaged app, since the user might see it and delete it, thinking
it's an erroneous file. Is there a way to save to a file and make
sure that it's either invisible to the user or inside the package
with the app?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ucla.edu
This email sent to email@hidden
_______________________________________________
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