 |
 |
Where to store global prefs?
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Moscow, Russia
Status:
Offline
|
|
I need my game app to store a set of user-independent data, specifically hi scores. I know it's senseless to keep them in the current user's domain since hi scores should be shared among all the users. I could store them in the application bundle, but I'm afraid it's an awkward solution. Another place is /Library/Preferences/, but I don't know how to ensure that the data will be written there and not into ~/Library/Preferences.
Does anybody know the solution Apple would recommend?
Thank you.
|
|
Make no assumptions
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status:
Offline
|
|
You might try /Library/Application Support/. It appears that all the permissions on the directory are set on with a default install, so it should be safe to just go ahead and create your high score file in that directory and write the scores there. Do check for errors, though, of course.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status:
Offline
|
|
I have a related question.
Is there a simple way to traverse the Library 'hierarchy' when looking for resources? For example, the screen saver application searches in <font face = "courier">~/Library/Screen Savers</font>, <font face = "courier">/Library/Screen Savers</font>, and <font face = "courier">/System/Library/Screen Savers</font> when looking for .saver bundles. I assume it looks in <font face = "courier">/Network/Library</font> as well.
Let's say I want to do something similar for "Sound Sets" instead of "Screen Savers". Is there a convenience method for searching through the Library folders or do I have to do it by hand with hard-coded paths?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2001
Status:
Offline
|
|
NSSearchPathForDirectoriesInDomains(NSLibraryDirec tory, NSAllDomainsMask, YES) will give you /System/Library, /Library, ~/Library, and /Network/Library
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|