On Sep 21, 2011, at 4:09 PM, Conrad Shultz wrote:

> And regarding my earlier query: I agree, this sounds like a reasonable
> place to use version numbers.  I just wanted to make sure you weren't
> trying to do something like determine whether a certain framework is
> available by looking at the OS version. :-)
> 
> (For anyone reading this in the list archives: please don't use OS
> version numbers for such tasks.)

Why not? I find it to be safer than checking for the existence of a method, 
because you never know if that method might have actually have existed before 
it went public, but in a less stable form or with different behavior. If this 
is the case, then just checking whether the method exists and calling it could 
produce who knows what behavior on older systems.

There’s also the case where an API exists, but is buggy on older versions, 
causing you to want to avoid that API unless you’re running at least a certain 
version of OS X (for example, -[NSURL URLByDeletingLastPathComponent] before 
Lion).

Charles_______________________________________________

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