Abnormal BOOL value only in iOS 18 Simulator after upgrading Xcode 16 & iOS 18 SDK

After upgrading to Xcode 16 and iOS 18 SDK, my Objective-C project has serious BOOL value errors only on iOS 18 Simulator. The same code works perfectly on real iPhone devices and Mac Catalyst.

When getting BOOL return values from methods or assigning system API results to BOOL properties, it generates unexpected negative large numbers. Since C language treats all non-zero values as true in if() judgment, our business logic is completely broken.

Could you please explain what underlying changes in iOS 18 Simulator or Xcode 16 compiler caused this BOOL parsing problem? Thank you.

Boolean values in C-based languages are complicated, and it’s very easy to mistaken relying on behaviour that’s not actually defined by the language. Can you give me an example of specific code that’s actually having problems?

Also, please re-test on a modern version of Xcode, so Xcode 26.6 or Xcode 27 beta. Chasing Xcode 16 issues is kinda pointless at this point, given that you can no longer upload an Xcode 16 built app to the App Store.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Abnormal BOOL value only in iOS 18 Simulator after upgrading Xcode 16 & iOS 18 SDK
 
 
Q