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

Re: NSOpenPanel not honoring some settings


  • Subject: Re: NSOpenPanel not honoring some settings
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 31 May 2011 21:35:14 -0700

On May 31, 2011, at 21:00, Tito Ciuro wrote:

>>    [openPanel setAllowedFileTypes:[NSArray arrayWithObject:@"plist"]];
>>    [openPanel beginSheetForDirectory:NSHomeDirectory() file:nil modalForWindow:window modalDelegate:self didEndSelector:@selector(didEndImportSheet:returnCode:contextInfo:) contextInfo:NULL];

You're using the wrong methods for NSOpenPanel. These methods are for NSSavePanel, prior to 10.6.

For 10.5 compatibility, use the deprecated 'beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:' method and specify the file type array as a parameter.

Or for 10.6 only, use 'beginSheetModalForWindow:completionHandler:' in combination with 'setAllowedFileTypes:'.

Also see here:

	http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSSavePanel_Class/Reference/Reference.html

under the 'setAllowedFileTypes:' method description, for a note about NSOpenPanel.


_______________________________________________

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: Tito Ciuro <email@hidden>
References: 
 >NSOpenPanel not honoring some settings (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Re: iOS: getting the shakes
  • Next by Date: [SOLVED] Re: iOS: getting the shakes
  • Previous by thread: NSOpenPanel not honoring some settings
  • Next by thread: Re: NSOpenPanel not honoring some settings
  • Index(es):
    • Date
    • Thread