• 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: NSOpenPanel and field setting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel and field setting


  • Subject: Re: NSOpenPanel and field setting
  • From: Alan Hart <email@hidden>
  • Date: Tue, 18 Apr 2006 17:46:36 +0100


On 18 Apr 2006, at 16:18, Alan Smith wrote:

I have an NSOpenPanel that I want to open a folder. The question is, in
beginSheetForDirectory... what do I set "types" to be if I want the user to
select a folder and not a file?

I know this one :-)

		NSOpenPanel *panel = [NSOpenPanel openPanel];
		[panel setCanChooseDirectories: YES];
		[panel setCanChooseFiles: NO];
		[panel setTitle: @"Please Choose A Folder"];
		[panel setPrompt: @"Choose"];
		if ( [panel runModalForTypes: nil] == NSOKButton) {
			folder = [[panel URLs] objectAtIndex: 0];
			// ... do what you want with the folder
		}
-- Alan
_______________________________________________
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


References: 
 >NSOpenPanel and field setting (From: "Alan Smith" <email@hidden>)

  • Prev by Date: Re: Interface Builder Date Localization
  • Next by Date: What happens to my German strings?
  • Previous by thread: NSOpenPanel and field setting
  • Next by thread: Re: NSOpenPanel and field setting
  • Index(es):
    • Date
    • Thread