Re: FindFolder Equivalent?
Re: FindFolder Equivalent?
- Subject: Re: FindFolder Equivalent?
- From: Douglas Davidson <email@hidden>
- Date: Mon, 7 May 2001 09:44:53 -0700
I'm new to Cocoa (and the Mac environment in general) and I was
wondering if Cocoa has a method that is equivalent to the Carbon
FindFolder function. I don't want to hard code paths in my source if
I can help it.
There is two low-level functions in /usr/include/NSSystemDirectories.h,
and the somewhat higher level function
NSSearchPathForDirectoriesInDomains() in Foundation/NSPathUtilities.h.
These will return to you the paths for various common top level
directories in various domains. In some cases you might have to append a
hard-wired component to the path. (For instance, there are no selectors
for the various subdirectories in Library.)
In addition to what Ali said, I would like to add that there is nothing
preventing you from using FindFolder from within a Cocoa application, if
you find that it has functionality that you want that is not in
NSSystemDirectories.h. The NSSystemDirectories.h functions are more
convenient from within Cocoa, because they return paths that can be used
directly by the Cocoa APIs, but FindFolder does have some functionality
that they do not.
Douglas Davidson