• 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: Find the 'Application Support' folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find the 'Application Support' folder


  • Subject: Re: Find the 'Application Support' folder
  • From: John Stiles <email@hidden>
  • Date: Tue, 12 Oct 2004 09:40:46 -0700


On Oct 12, 2004, at 9:21 AM, Charles Srstka wrote:

FSFindFolder works, but I have always wondered why Apple hasn't built in a Cocoa API for accessing these folders. Having to go through Carbon to do this is kind of annoying.

Yes, there are third-party categories that give this functionality, but it really should be part of the default API.

I've never understood this attitude. I must be missing something, because to me it feels elitist.

What's the difference between calling FSFindFolder and, say, [NSFolder folder:kApplicationSupportFolder]? One isn't inherently better than the other, and there's no reason to think that AppKit is the best way to do EVERYthing. AppKit is really, really good at most stuff, so we get used to relying on it, but they haven't managed to get every Mac-related idiosyncrasy wedged in there yet, so there are still some pretty glaring gaps (like this one, or types and creators, or aliases, etc etc). And honestly I don't think Apple is providing much extra value if they spend all their time writing each API twice, once with brackets and once without :) Sure, FSRef isn't a super-common type to be passing around in Cocoa code, but you're one call away from turning that into a path, and you can easily encapsulate the entire conversion of FSRef->NSString within a tiny helper function.

NSString *FindFolderNS( .... )
{
FSRef myRef;
if( noErr != FSFindFolder( ... ) ) return NULL; // or maybe @"" ??
UInt8 path[PATH_MAX];
if( noErr != FSRefMakePath( ... ) ) return NULL;
return [NSString stringWithUTF8String:path];
}

Come on, that wasn't a big deal :) So I don't understand the complaining we see on this list any time we can't use AppKit to do something...

_______________________________________________
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
  • Follow-Ups:
    • Re: Find the 'Application Support' folder
      • From: Greg Hurrell <email@hidden>
    • Re: Find the 'Application Support' folder
      • From: stephane sudre <email@hidden>
References: 
 >Re: Find the 'Application Support' folder (From: Steven Kramer <email@hidden>)
 >Re: Find the 'Application Support' folder (From: "Sean McBride" <email@hidden>)
 >Re: Find the 'Application Support' folder (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Find the 'Application Support' folder
  • Next by Date: Pattern Image, Tiles or Texture
  • Previous by thread: Re: Find the 'Application Support' folder
  • Next by thread: Re: Find the 'Application Support' folder
  • Index(es):
    • Date
    • Thread