Re: NSOpenPanel not honoring some settings

2011-06-01 Thread Sean McBride
On Tue, 31 May 2011 21:50:17 -0700, Tito Ciuro said:

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

It's not exactly deprecated.  In the .h it says:

/* This method is deprecated in 10.6, and will be formally deprecated in
a future release. Use beginSheetModalForWindow:completionHandler:

And it's not tagged with __deprecated, so you get no warning.

I find it really annoying that they document methods are deprecated in
docs/comments, but don't actually tag them so the compiler can warn.  I
guess they're trying to reduce noise.  If so, might be nice to have 2
levels of deprecation warnings: really old, and soon-to-be-old. :)

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


Re: NSOpenPanel not honoring some settings

2011-05-31 Thread Quincey Morris
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 (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


Re: NSOpenPanel not honoring some settings

2011-05-31 Thread Tito Ciuro
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