Re: NSOpenPanel not honoring some settings
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