NSOpenPanel not respecting file types?
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