Re: How to print BOOLs
Re: How to print BOOLs
- Subject: Re: How to print BOOLs
- From: Quincey Morris <email@hidden>
- Date: Thu, 07 Aug 2014 21:34:53 -0700
On Aug 7, 2014, at 20:20 , Gerriet M. Denkmann <email@hidden> wrote:
I want to print a BOOL (which is documented to be a signed char) without any compiler warnings: NSLog(@"shouldAutorotate %hhd", self.shouldAutorotate); // inside some iOS program. Xocde 6 beta 5.
But I get "Format specifies type 'char' but the argument has type 'BOOL' (aka 'bool')".
No idea what this "bool" thing is. Also UIViewController's shouldAutorotate returns BOOL (at least the documentation says so).
BOOL got changed in the ARM 64-bit architecture for iOS 7 to be really boolean, instead of whatever it was before. I suspect that’s what you’re seeing here.
AFAIK it’s still an integer-based type in ARM 32-bit, and in all Intel architectures.
Roland’s suggestion of using the value to select a constant to display is probably the most compatible way of dealing with this.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden