RE: How to print BOOLs
RE: How to print BOOLs
- Subject: RE: How to print BOOLs
- From: Lee Ann Rucker <email@hidden>
- Date: Tue, 12 Aug 2014 08:09:50 +0000
- Thread-topic: How to print BOOLs
This works nicely, though it's probably overkill :)
NSLog(@"shouldAutorotate %@", @(self.shouldAutorotate));
________________________________________
From: xcode-users-bounces+lrucker=email@hidden [xcode-users-bounces+lrucker=email@hidden] on behalf of Gerriet M. Denkmann [email@hidden]
Sent: Thursday, August 7, 2014 8:20 PM
To: email@hidden
Subject: How to print BOOLs
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