• 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 honoring some settings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSOpenPanel not honoring some settings
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: iOS: getting the shakes
  • Next by Date: Re: iOS: getting the shakes
  • Previous by thread: [SOLVED] Re: iOS: getting the shakes
  • Next by thread: Re: NSOpenPanel not honoring some settings
  • Index(es):
    • Date
    • Thread