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

  • Follow-Ups:
    • Re: How to print BOOLs
      • From: Scott Ribe <email@hidden>
References: 
 >How to print BOOLs (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: How to print BOOLs
  • Next by Date: Re: How to print BOOLs
  • Previous by thread: Re: How to print BOOLs
  • Next by thread: Re: How to print BOOLs
  • Index(es):
    • Date
    • Thread