• 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: Andy Lee <email@hidden>
  • Date: Wed, 20 May 2009 23:45:18 -0400

On May 20, 2009, at 11:43 AM, Jeff Decker 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. Perhaps you were expecting them to return a string @"YES" or @"NO", but that's not what they do.


You can replace the %@ with %d and you will get either a 0 (meaning NO) or a 1 (meaning YES).

See the docs on "String Format Specifiers":

<http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html >

--Andy

_______________________________________________

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: "Sean McBride" <email@hidden>
References: 
 >isKindOfClass returns null instead of YES or NO (From: Jeff Decker <email@hidden>)

  • Prev by Date: isKindOfClass returns null instead of YES or NO
  • Next by Date: Re: isKindOfClass returns null instead of YES or NO
  • Previous by thread: isKindOfClass returns null instead of YES or NO
  • Next by thread: Re: isKindOfClass returns null instead of YES or NO
  • Index(es):
    • Date
    • Thread