Hi Quincey,

On May 31, 2011, at 9:35 PM, Quincey Morris wrote:

> 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.

I don't know how I missed this...

I wish Xcode 4 had warned me that 
'beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:'
 has been deprecated in 10.6. That would have saved some trouble!

Thanks a lot for the help,

-- 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