Environment: Xcode 16, iOS 18 Simulator, Objective-C, Debug build.
Problem:
After upgrading to iOS 18 SDK, BOOL values behave abnormally exclusively on the iOS 18 simulator:
BOOL properties assigned with system API return values are truncated to negative numbers;
__block BOOL variable logged as 0, but the function returns a huge negative integer after dispatch_sync, leading to wrong if condition judgment.
All code runs correctly on physical iOS devices and Mac Catalyst. I temporarily fixed it by replacing BOOL type with int to store only 0 and 1.
I just want to confirm: what changes in iOS 18 Simulator runtime or Xcode 16 compiler lead to this signed char BOOL overflow/extension issue?
Topic:
Community
SubTopic:
Apple Developers
1
0
322