Re: PSA: floor(NSFoundationVersionNumber) doesn't work with Yosemite or later
Re: PSA: floor(NSFoundationVersionNumber) doesn't work with Yosemite or later
- Subject: Re: PSA: floor(NSFoundationVersionNumber) doesn't work with Yosemite or later
- From: Ben Kennedy <email@hidden>
- Date: Fri, 10 Jul 2015 17:31:13 -0700
On 10 Jul 2015, at 12:01 pm, Charles Srstka <email@hidden> wrote:
> What this means is that if you try to use an El Capitan-only feature and put it in a block that starts with a check on floor(NSFoundationVersionNumber) or floor(NSAppKitVersionNumber) to make sure it’s larger than the value for 10.10.0, your code in that block will get called on all versions of 10.10.x greater than 10.10.1.
NSObjCRuntime.h only declares a reference version constant for up to 10.9.2 (NSFoundationVersionNumber10_9_2). I presume your methodology relies on an empirical determination of what later versions of Foundation appear to expose?
But even if you were going to use such an approach (which seems unwise, as you said yourself, considering NSProcessInfo), why on earth would you do a greater-than comparison against the "today's last known version" of 10.10.x, rather than a greater-than-or-equal-to comparison against what you can today observe is exposed by 10.11.0?
> Once Yosemite stops being updated, we can of course use the constant for the last version that’s released, but since we still can’t say with 100% certainty that there won’t be a 10.10.5, we can’t really rely on this.
No kidding. (Never mind the fact that the notion of using a floating point number for such identification is inherently laughable, but I guess that was codified in yore.)
b
_______________________________________________
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