• 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: 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


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

  • Prev by Date: Re: Weird storyboard connection issue
  • Next by Date: Re: Archiving Frameworks?
  • Previous by thread: Re: How to print BOOLs
  • Next by thread: RE: How to print BOOLs
  • Index(es):
    • Date
    • Thread