• 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: isKindOfClass returns null instead of YES or NO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isKindOfClass returns null instead of YES or NO


  • Subject: Re: isKindOfClass returns null instead of YES or NO
  • From: Gwynne Raskind <email@hidden>
  • Date: Thu, 21 May 2009 12:53:33 -0400

On May 21, 2009, at 12:33 PM, Sean McBride wrote:
		NSLog(@"Is Member of NSURL: %@", [[step class] isMemberOfClass:
[NSURL class]]);
The %@ placeholder is for arguments that are objects.
isMemberOfClass: and isKindOfClass: return a BOOL, which is not an
object.
Jeff,

And if you're wondering if the compiler could warn you that %@ and BOOL
do not match, the answer is unfortunately no. -Wformat=2 can give such
warnings when using sprintf() and friends, but not NSString methods.
One of my pet peeves. :)


Interestingly enough, if you pop over to:

http://www.opensource.apple.com/source/gcc_42/gcc_42-5531/gcc/c-format.c

You will find that Apple has indeed dropped in -Wformat checks for "nsstring_format_type" and "cfstring_format_type". But if you scroll down a ways further, you'll find that OOPS!, Apple hasn't actually implemented those types, at least not completely. One wonders why. Bug filing time, anyone?

-- Gwynne, Daughter of the Code
"This whole world is an asylum for the incurable."



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: isKindOfClass returns null instead of YES or NO
      • From: Bill Bumgarner <email@hidden>
References: 
 >isKindOfClass returns null instead of YES or NO (From: Jeff Decker <email@hidden>)
 >Re: isKindOfClass returns null instead of YES or NO (From: Andy Lee <email@hidden>)
 >Re: isKindOfClass returns null instead of YES or NO (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: problems with inspector window
  • Next by Date: Re: Privilege elevation of a cocoa app
  • Previous by thread: Re: isKindOfClass returns null instead of YES or NO
  • Next by thread: Re: isKindOfClass returns null instead of YES or NO
  • Index(es):
    • Date
    • Thread