They say its fixed but

Hmmm since thats the OS provided function I’m surprised its not returning the right thing

Thats the code from this post ?

And note the Attribute setting for Structure Alignment (otherwise you can get incorrect results)

I know that 10.16 was a screwy thing they did with … Catalina ???

Other than that I’d need to set up a VM with Monterey to try things & see

I actually pulled the code from your KitchenSink project and copy and pasted the structure so the alignment attribute came with it…

The above was on my machine at work…

On my Mac at home which is also running 12.6.8, I get the same thing as at work.

10.16.0

If it matters, both are Intel Macs.

The only reason I care about OS version right now, is that I need to use a declare that is only available in MacOS 12 and above that Greg provided on TOF in an app I’m working on, and want to avoid problems on older OS versions.

-Karen

Big Sur on intel reports 10.16
Big Sur on arm reports 11

I hadn’t heard about that seeping into anything newer.

If I remember correctly, you can determine if a declare will work with declares rather than checking the os version. I don’t recall the specific function at the moment though.

By hacking the SDK version of the executable. Apps which are not built against macOS 11 (edit: or newer), see 10.16.

This is done for good reason as some things do NOT behave the same with older SDKs.

p.s. App Wrapper will allow you to hack the SDK version, I wrote that in so I could use some of the newer Big Sur features before Xojo even dreamed of it, and then forgot about it renaming all the things.

1 Like

Yes all i want to know is if the declare I want to use is supported on that version of the OS… If not, the declare is not needed.

I think you are talking about System.isFunctionAvailable… but the docs say:

Then they also go on to say:

An example in the docs could have made clear how to do that, but it’s not clear to me.

  • Karen

How would that tell me if the app running on a MacOS version >= 12?

  • Karen

Major version would be 12 >=

Below is some code where I set booleans allowing me to pick and choose colors and things. This kind of action is NOT recommended by Apple btw, they instead recommend checking for classes and methods.

Dim currentOS as NSOperatingSystemVersion = NSProcessInfo_operatingSystemVersion( NSProcessInfo_processInfo( NSProcessInfoClass ) )

Dim cOS as integer = cdbl( right( "00" + str( currentOS.major ), 2 ) + right( "00" + str( currentOS.minor ), 2 ) + _
right( "00" + str( currentOS.bug ), 2 ) )

operatingSystemisAtLeastVentura = cOS >= 130000
operatingSystemisAtLeastBigSur  = cOS >= 101600
operatingSystemisAtLeastMojave  = cOS >= 101400

Below is an example of how Apple recommends things to be handled. This code asks the OS for the presence of the “effectiveAppearance” method and sets a global property to use that method, otherwise fall back to the pre 10.14 version.

This particular function is used to determine if a control/view has a dark appearance or not.

// --- We test the global shared application instance.
if NSObject_respondsToSelector( NSApplication_sharedApplication, NSSelectorFromString( "effectiveAppearance" ) ) then
  appearanceFunctionSelector = NSSelectorFromString( "effectiveAppearance" )
  
else
  appearanceFunctionSelector = NSSelectorFromString( "appearance" )
  
end if

FWIW, respondsToSelector was the function I couldn’t recall. I too would recommend you go down that route. You can probably find examples by searching TOF.

Thanks Tim. Searching the TOF for respondsToSelector got me what i needed… That stuff is NOT very straight forward!

  • Karen