Re: Files in Application Support
Re: Files in Application Support
- Subject: Re: Files in Application Support
- From: Andreas Mayer <email@hidden>
- Date: Tue, 3 Aug 2004 01:05:35 +0200
Am 02.08.2004 um 23:51 Uhr schrieb Koen van der Drift:
Or maybe I should use NSUserDefaults for this?
That's what I'd do.
IIRC, in Mac OS, paths to various folders in the System Folder were
defined, but I couldn't find something similar for OS X.
I think you have to use Carbon. I added this method as a category to
NSFileManager:
- (NSString *)findSystemFolderType:(int)folderType forDomain:(int)domain
{
FSRef folder;
OSErr err = noErr;
CFURLRef url;
NSString *result = nil;
err = FSFindFolder(domain, folderType, false, &folder);
if (err == noErr) {
url = CFURLCreateFromFSRef(kCFAllocatorDefault, &folder);
result = [(NSURL *)url path];
}
return result;
}
Getting the Application Support folder:
NSString *applicationSupportFolder = [[NSFileManager defaultManager]
findSystemFolderType:kApplicationSupportFolderType
forDomain:kUserDomain];
Andreas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.