real noob question about CF functions with Cocoa
real noob question about CF functions with Cocoa
- Subject: real noob question about CF functions with Cocoa
- From: Ron Fleckner <email@hidden>
- Date: Thu, 15 Jun 2006 14:50:13 +1000
Hi,
I hope this doesn't annoy anyone, but I'd really like to know.
Please stop reading now if you don't like dumb questions.
I wanted the user to be able to choose an item from a list and send
it to the Trash. I found a great little example function in the docs
at: Reference Library > Guides > Cocoa > File Management > Low-Level
File Management Programming Topics > Locating Directories on the
System. It's at the bottom of that page. I use it and it works,
though I couldn't tell you how or why. As the docs state just above
the example which I shamelessly copied and pasted into my own code,
You can also use functions of the Carbon Folder Manager to get
paths to standard directories in the file system. (The Folder
Manager is defined in Folder.h in the Carbon Core framework, which
is a subframework of the Core Services umbrella framework.) Perhaps
the most useful function for Cocoa programs is FSFindFolder. This
function (as well as others of the Folder Manager) return the found
path typed as a FSRef. To use this value in Cocoa, you must first
convert it to a Core Foundation CFURL object, then to a CFString
object, and finally to an NSString object. “Listing 2” shows how
you might call FSFindFolder and convert the returned value to
obtain a path used in moving a file to the user’s Trash folder.
So, what IS Core Foundation, really? Do people write software using
only Core Foundation? What relation does it have to Cocoa?
Ron Fleckner _______________________________________________
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