• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Files in Application Support
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Files in Application Support (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: Terminate Process By Name
  • Next by Date: Binding woes, connecting model to NSArrayController, crash on remove/insert
  • Previous by thread: Files in Application Support
  • Next by thread: Re: Terminate Process By Name
  • Index(es):
    • Date
    • Thread