• 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 vs. loading bundles: nope?!?!?!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isKindOfClass vs. loading bundles: nope?!?!?!?


  • Subject: Re: isKindOfClass vs. loading bundles: nope?!?!?!?
  • From: Marco Scheurer <email@hidden>
  • Date: Thu, 21 Mar 2002 17:10:07 +0100

On Thursday, March 21, 2002, at 04:07 pm, Ondra Cada wrote:

No, the zero makes sense. Remember, "class" is a Class, not an instance.
If you wanted to see a 1 instead of the 0, you could change that NSLog line to:

NSLog(@"got a class %@ (%d)",s,
[[[class alloc] init] isKindOfClass:[MLLoadableObject class]]);

(i) it would seem kind of silly to make an instance just to check class relationship, would it not?
(ii) all NSObject instance methods are by definition class methods too
That I did, but am still kinda bewildered that such a very basic thing like kindOfClass: does not work?!?

A class object is a kind of NSObject.

[[self class] isKindOfClass:[self class]] returns NO
[[self class] isKindOfClass:[NSObject class]] returns YES

And this has nothing to do with loading bundles.

That I did, but am still kinda bewildered that such a very basic thing like kindOfClass: does not work?!?

It works accordingly with the Objective C language definition.

Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: isKindOfClass vs. loading bundles: nope?!?!?!? (From: Ondra Cada <email@hidden>)

  • Prev by Date: NSStatusItem
  • Next by Date: Re: isKindOfClass vs. loading bundles: nope?!?!?!?
  • Previous by thread: Re: isKindOfClass vs. loading bundles: nope?!?!?!?
  • Next by thread: Re: isKindOfClass vs. loading bundles: nope?!?!?!?
  • Index(es):
    • Date
    • Thread