• 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: Path to desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Path to desktop (From: Micha Fuhrmann <email@hidden>)

  • Prev by Date: Path to desktop
  • Next by Date: Re: Path to desktop
  • Previous by thread: Path to desktop
  • Next by thread: Re: Path to desktop
  • Index(es):
    • Date
    • Thread