• 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: allow user to select a directory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: allow user to select a directory


  • Subject: Re: allow user to select a directory
  • From: Ricky Sharp <email@hidden>
  • Date: Mon, 7 May 2007 19:27:59 -0500


On May 7, 2007, at 7:20 PM, Nick Zitzmann wrote:


On May 7, 2007, at 6:15 PM, Roland Silver wrote:

[[NSOpenPanel openPanel] runModal] only allows the user to select a file, not a directory.

How to allow the user to select a directory?

Like this: (disclaimer - written in Mail, untested, use at your own risk, and all that)


NSOpenPanel *panel = [NSOpenPanel openPanel];

[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel runModal];

Did you know about the NSOpenPanel documentation? I found that just by looking...

There's also a sample here (also found after a quick search):

<http://cocoadev.com/index.pl?DirectoryOpenPanel>

This sample sets the flag to also allow the creation of directories during the selection process.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >allow user to select a directory (From: Roland Silver <email@hidden>)
 >Re: allow user to select a directory (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: allow user to select a directory
  • Next by Date: Serial port through USB help
  • Previous by thread: Re: allow user to select a directory
  • Next by thread: Serial port through USB help
  • Index(es):
    • Date
    • Thread