Run-time test for 10.14 when using 10.13 SDK


John Brownie
 

Because of other issues, I am having to use Xcode 9.4.1 for my app. However, there is one function that depends on a third-party tool which fails on macOS 10.14. I'd like to disable the command that causes the failure at run-time, so I'm looking for a way to tell whether I'm running on a system later than 10.13. Normally I've done that by checking availability of a particular function, but that depends on having a later SDK. Is there a different way to do it? The code that needs to check is in Obj-C.

(This is only a temporary solution, while I try to get the tool replaced, and complete the rewrite of the whole app into Swift.)

Thanks in advance,
John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland


Chris Hanson
 

There’s always the NSProcessInfo.operatingSystemVersion property.

-- Chris


Alex Zavatone
 

There should be a macro defined for the OS version. Apple uses these a lot in their headers. Look at a few class headers and you should see enough examples.

Cheers from Chennai,
Alex Zavatone.

On Nov 7, 2018, at 1:05 PM, John Brownie <john_brownie@...> wrote:

Because of other issues, I am having to use Xcode 9.4.1 for my app. However, there is one function that depends on a third-party tool which fails on macOS 10.14. I'd like to disable the command that causes the failure at run-time, so I'm looking for a way to tell whether I'm running on a system later than 10.13. Normally I've done that by checking availability of a particular function, but that depends on having a later SDK. Is there a different way to do it? The code that needs to check is in Obj-C.

(This is only a temporary solution, while I try to get the tool replaced, and complete the rewrite of the whole app into Swift.)

Thanks in advance,
John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland



John Brownie
 

Thanks, that's what I needed.

John

Chris Hanson wrote on 7/11/18 22:18:

There’s always the NSProcessInfo.operatingSystemVersion property.

-- Chris
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland