Re: Path to desktop
Re: Path to desktop
- Subject: Re: Path to desktop
- From: "Clark Cox" <email@hidden>
- Date: Mon, 9 Jul 2007 09:48:36 -0700
On 7/9/07, Micha Fuhrmann <email@hidden> wrote:
Ok,
I'm bit tired today, sorry for my laziness, I just need the full path
of the User's desktop, how can I get it in 3 simple lines of code, I
would hate to resort to an Apple Script that gives me what I want in
6 words (set thePath to path to desktop)! Here's what I've played with:
NSArray* paths = NSSearchPathForDirectoriesInDomains
( NSDesktopDirectory, NSUserDomainMask, NO );
NSString *theDesktopPath = [paths objectAtIndex:0];
What's wrong with this?
Do I really need to reconstruct the full path with stringByAppendingPathComponent ?
What full path are you trying to construct. The above code just gave
you the path to the Desktop. Maybe if you explained precisely what is
wrong with the result that the above snippet gives you, I could give
you a more helpful response.
There's got to be something simple!!!
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden