• 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
NSOpenPanel not respecting file types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOpenPanel not respecting file types?


  • Subject: NSOpenPanel not respecting file types?
  • From: Kiel Gillard <email@hidden>
  • Date: Mon, 3 Jul 2006 17:15:05 +1000

Hi all,

I'm writing a preference pane for System Preferences which requires the user to choose applications. To do this, I decided to use NSOpenPanel and set the allowableFileTypes to an array containing one string, @"app". However, the open panel does not seem to limit the user's selection to applications. Furthermore, if I specify a different type, such as @"rtf", the open panel does not limit the user's selection to rtf files.

I also believe this is always reproduceable. Below are steps one can take to reproduce the problem. Can anyone please tell me if I am doing something incorrectly or if there is something wrong with NSOpenPanel:

1) Create a new project from the PreferencePane template.
2) Implement the following code in the - (void)mainViewDidLoad delegate method:


/* begin code */

	NSOpenPanel *panel = [NSOpenPanel openPanel];
	NSArray *types = [NSArray arrayWithObject:@"app"];
	//NSLog(@"types == %@", types);
	[panel setAllowedFileTypes:types];

	[panel beginSheetForDirectory:nil
							 file:nil
				   modalForWindow:[NSApp mainWindow]
					modalDelegate:self
				   didEndSelector:NULL
					  contextInfo:NULL];

/* end code */

3) Build (the default build configuration should be Release).
4) Double click the Preference Pane build to install and run it.

Any thoughts? Should I file bug report? Thanks for any assistance.

Kiel :-)
"Black holes are where God divided by zero."
Steven Wright
_______________________________________________
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


  • Prev by Date: Outlet connecting two custom classes
  • Next by Date: Re: Distributed Objects and Bonjour
  • Previous by thread: Re: Outlet connecting two custom classes
  • Next by thread: Re: NSOpenPanel not respecting file types?
  • Index(es):
    • Date
    • Thread