On 18 Sep 2009, at 16:03, Philippe Roussel wrote:

Hi all,

Currently I'm using the hardcoded path @"~/GNUstep/Library/ SimpleAgenda" to save the local calendars users create in SimpleAgenda (if I create a
local agenda called 'private', it will be saved in the file
~/GNUstep/Library/SimpleAgenda/private).

I am wondering if :

- it's a good place to save user data

Yes, it's a good place. Apple tends to favour putting things in Library/Application Support/{AppName} but Library/{AppName} is also fine.

- if there's a better way (not harcoded) to get this directory,
something like [NSApp libraryPath] ?

You want to call:

NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);

This should contain a one-entry NSArray instance containing (the tilde- expanded form of) ~/GNUstep/Library. Then use - stringByAppendingPathComponent: to add the 'private' bit.

David


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to