• 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
Does +isSubclassOfClass work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Does +isSubclassOfClass work?


  • Subject: Does +isSubclassOfClass work?
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Thu, 1 Jan 2004 16:04:10 +0100

Is there something that I don't understand with NSObject +isSubclassOfClass: ?
If you fire a simple foundation tool with only this content:


int main () {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

Class s = [NSObject class];
Class c = [pool class];

if ([s isSubclassOfClass:c]) return 1;
NSCAssert ([c superclass] != s, @"error!") ;
return 0;
}

then it seems to me that the assertion should always be ok (actually the function should return 1). But it doesn't, and the assertion fails!
(Note that it doesn't matter which classes are used, here it is NSObject and NSAutoreleasePool but I got the problem with other classes before this simple test.)

Any insight on this?

Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Does +isSubclassOfClass work?
      • From: James Spencer <email@hidden>
  • Prev by Date: [OT] Any way to make more session?
  • Next by Date: I know this isn't really a cocoa prob.... but please help
  • Previous by thread: [OT] Any way to make more session?
  • Next by thread: Re: Does +isSubclassOfClass work?
  • Index(es):
    • Date
    • Thread