Re: How to print BOOLs
Re: How to print BOOLs
- Subject: Re: How to print BOOLs
- From: Jeremy Pereira <email@hidden>
- Date: Mon, 11 Aug 2014 11:44:02 +0100
As has been said, the definition has changed on 64 bit ARM/iOS. However, when I want to print a boolean value, I tend to go for something like:
NSLog(@"shouldAutorotate %s", self.shouldAutorotate ? "YES" : "NO");
which gives a more human readable log message and doesn't care how the boolean values are implemented.
On 8 Aug 2014, at 04: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).
>
> Gerriet.
>
>
>
>
>
> _______________________________________________
> 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
_______________________________________________
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