• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: How to print BOOLs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to print BOOLs (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: start with Xcode 5.1.1
  • Next by Date: Re: Xcode 5.1.1 OS X 10.9.4
  • Previous by thread: Re: How to print BOOLs
  • Next by thread: Re: OS X 10.9.4, Xcode 5.1.1 and mysql-5.6.20-osx10.8-x86_64
  • Index(es):
    • Date
    • Thread