Re: Gestalt
Re: Gestalt
- Subject: Re: Gestalt
- From: Charles Srstka <email@hidden>
- Date: Wed, 21 Sep 2011 16:22:12 -0500
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 (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