NSOpenPanel not honoring some settings
NSOpenPanel not honoring some settings
- Subject: NSOpenPanel not honoring some settings
- From: Tito Ciuro <email@hidden>
- Date: Tue, 31 May 2011 21:00:48 -0700
Hello,
I'm trying to display an NSOpenPanel that only allows to select plist files. I have the following code in place:
> NSOpenPanel *openPanel = [NSOpenPanel openPanel];
>
> [openPanel setResolvesAliases:YES];
> [openPanel setCanChooseDirectories:NO];
> [openPanel setAllowsMultipleSelection:NO];
> [openPanel setCanChooseFiles:YES];
> [openPanel setPrompt:@"Open"];
> [openPanel setAllowedFileTypes:[NSArray arrayWithObject:@"plist"]];
> [openPanel beginSheetForDirectory:NSHomeDirectory() file:nil modalForWindow:window modalDelegate:self didEndSelector:@selector(didEndImportSheet:returnCode:contextInfo:) contextInfo:NULL];
The documentation about setAllowedFileTypes states that "The file type can be a common file extension, or a UTI"... so I have no idea why the plist extension is not being honored. To make things more interesting, I can select directories (even though I have set setCanChooseDirectories with NO).
Any idea why it's not working? What am I missing?
Thanks!
-- Tito
_______________________________________________
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