• 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: "Jim Turner" <email@hidden>
  • Date: Mon, 9 Jul 2007 11:50:21 -0500

NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Desktop"];

That should do what you need.

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];

Do I really need to reconstruct the full path with
stringByAppendingPathComponent ?

There's got to be something simple!!!

Any help very much appreciated.

Micha
_______________________________________________

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



--
Jim
http://nukethemfromorbit.com
_______________________________________________

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


  • Follow-Ups:
    • Re: Path to desktop
      • From: "Shawn Erickson" <email@hidden>
    • Re: Path to desktop
      • From: "Sean McBride" <email@hidden>
References: 
 >Path to desktop (From: Micha Fuhrmann <email@hidden>)

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