• 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: object type testing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: object type testing


  • Subject: Re: object type testing
  • From: Andy Lee <email@hidden>
  • Date: Sun, 7 May 2006 14:18:47 -0400

On May 7, 2006, at 12:56 PM, Lawrence Sanbourne wrote:
On 5/7/06, Ben Dougall <email@hidden> wrote:
Todd, thanks for the reply.

On Sunday, May 7, 2006, at 05:03  pm, Todd Blanchard wrote:

> isKindOfClass: I think tests to see if you are a subclass of a given
> class. Its what I have used before.


i'm not after subclasses though -- just is of a particular type or not. [...]

-isKindOfClass: actually returns YES if the object is a member of the given class or is a subclass of the given class. This is probably the behavior you want,

Ben specifically said he doesn't want the -isKindOfClass: test, and the code options in his original message are consistent with this. Since we don't know what the context is, we don't have enough information to second-guess.


*Assuming* specific class membership is the desired test, offhand I would use -isMemberOfClass: instead of comparing class objects, just because I think it reads better, but I doubt it makes any practical difference. Conceivably for debugging it might be useful to break on -isMemberOfClass:, or replace it via +poseAsClass:, but if your situation is very simple it probably doesn't matter.

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: object type testing (From: Todd Blanchard <email@hidden>)
 >Re: object type testing (From: Ben Dougall <email@hidden>)
 >Re: object type testing (From: "Lawrence Sanbourne" <email@hidden>)

  • Prev by Date: DXT1/3/5 image format - where to get a NSImageRep
  • Next by Date: Re: object type testing
  • Previous by thread: Re: object type testing
  • Next by thread: Re: object type testing
  • Index(es):
    • Date
    • Thread