The objective C code using the kernel API ‘sysctlbyname’ for ‘kern.osproductversion’ returns 16.0 instead of 26.0 on macOS Tahoe.
sysctlbyname("kern.osproductversion", version, &size, NULL, 0)
The command ‘sysctl kern.osproductversion’ returns ‘kern.osproductversion: 26.0’ on same macOS Tahoe.
Note: The objective C code was built using Xcode 16.3.
Yep. You would’ve seen the same thing during the macOS 10.15 to macOS 11 version number discontinuity. If you build with Xcode 26 beta, and thus the Xcode 26 beta SDK, it’ll start returning 26.0.
I provide more background to this phenomenon in this thread.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"