Re: NSAppKitVersionNumber wrong on latest Big Sur versions?!

2023-01-06 Thread Sean McBride via Cocoa-dev
On 6 Jan 2023, at 16:27, Rob Petrovec wrote:

> Yes, this is a bug that started in 11.7 that doesn’t appear to have been 
> fixed yet in 11.7.2.

Thanks for the confirmation.  Sad that such a serious regression wasn't fixed 
in 11.7.1 nor 11.7.2.

> Have you tried the arguably more robust and less error prone runtime checks 
> of:
>
> Swift
> if #available(macOS 10.16, *) {
>   // macOS 10.16 or later code path
> } else {
>   // code for earlier than 10.16
> }
>
> Objective-C
> if (@available(macOS 10.16, *)) {
>   // macOS 10.16 or later code path
> } else {
>   // code for earlier than 10.16
> }

I'm aware of them, tried switching once, but found that they did not work as 
expected, at least with older Xcodes.  The note I left in my code was:

TODO: "if (@available(macOS 11, *))" doesn't work properly!  It seems to only 
do the right thing if you use at least Xcode 12.2.

Seeing your example makes me wonder if "10.16" would have worked in place of 
"11"...

Sean
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSAppKitVersionNumber wrong on latest Big Sur versions?!

2023-01-06 Thread Rob Petrovec via Cocoa-dev
Yes, this is a bug that started in 11.7 that doesn’t appear to have been fixed 
yet in 11.7.2.

Have you tried the arguably more robust and less error prone runtime checks of:

Swift
if #available(macOS 10.16, *) {
  // macOS 10.16 or later code path
} else {
  // code for earlier than 10.16
}

Objective-C
if (@available(macOS 10.16, *)) {
  // macOS 10.16 or later code path
} else {
  // code for earlier than 10.16
}

—Rob


> On Jan 6, 2023, at 1:32 PM, Sean McBride via Cocoa-dev 
>  wrote:
> 
> Hi all,
> 
> On at least 3 Macs in my office, running macOS 11.7 or 11.7.2, 
> NSAppKitVersionNumber (at runtime) is 2202.7 (sic).  This conflicts with 
> NSApplication.h which has:
> 
> static const NSAppKitVersion NSAppKitVersionNumber11_0 = 2022;
> static const NSAppKitVersion NSAppKitVersionNumber11_1 = 2022.2;
> static const NSAppKitVersion NSAppKitVersionNumber11_2 = 2022.3;
> static const NSAppKitVersion NSAppKitVersionNumber11_3 = 2022.4;
> static const NSAppKitVersion NSAppKitVersionNumber11_4 = 2022.5;
> static const NSAppKitVersion NSAppKitVersionNumber11_5 = 2022.6;
> 
> I had a macOS 11.2 installer lying around, and installed it in a VM, and 
> there NSAppKitVersionNumber is 2022.3 as expected.
> 
> I can't help but note that 2202 looks like a typo vs 2022!
> 
> As 2202.7 is larger than NSAppKitVersionNumber12_0 (2113) it results in going 
> into branches that should be Monterey-only.  Ouch.
> 
> Has anyone else observed this?
> 
> Thanks,
> 
> Sean
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com
> 
> This email sent to petr...@mac.com

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSAppKitVersionNumber wrong on latest Big Sur versions?!

2023-01-06 Thread Sean McBride via Cocoa-dev
Hi all,

On at least 3 Macs in my office, running macOS 11.7 or 11.7.2, 
NSAppKitVersionNumber (at runtime) is 2202.7 (sic).  This conflicts with 
NSApplication.h which has:

static const NSAppKitVersion NSAppKitVersionNumber11_0 = 2022;
static const NSAppKitVersion NSAppKitVersionNumber11_1 = 2022.2;
static const NSAppKitVersion NSAppKitVersionNumber11_2 = 2022.3;
static const NSAppKitVersion NSAppKitVersionNumber11_3 = 2022.4;
static const NSAppKitVersion NSAppKitVersionNumber11_4 = 2022.5;
static const NSAppKitVersion NSAppKitVersionNumber11_5 = 2022.6;

I had a macOS 11.2 installer lying around, and installed it in a VM, and there 
NSAppKitVersionNumber is 2022.3 as expected.

I can't help but note that 2202 looks like a typo vs 2022!

As 2202.7 is larger than NSAppKitVersionNumber12_0 (2113) it results in going 
into branches that should be Monterey-only.  Ouch.

Has anyone else observed this?

Thanks,

Sean
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com