Post

Replies

Boosts

Views

Activity

Incorrect BOOL return value in iOS 18 Simulator (works on device and Mac Catalyst)
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?
1
0
322
18h
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.
1
0
44
1d
Incorrect BOOL return value in iOS 18 Simulator (works on device and Mac Catalyst)
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?
Replies
1
Boosts
0
Views
322
Activity
18h
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.
Replies
1
Boosts
0
Views
44
Activity
1d