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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to