Re: Class introspection [was Re: Forcing allocation of a subclass]

2009-01-25 Thread João Varela
No, isKindOfClass check for the superclass. It returns true if self class is myClass or a subclass of myClass. You should use isMemberOfClass: to got something equivalent. Yes, you are right. Thanks for pointing it out. because in the first example we are calling -class: in [self class

Re: Class introspection [was Re: Forcing allocation of a subclass]

2009-01-25 Thread Jean-Daniel Dupas
Le 25 janv. 09 à 19:54, João Varela a écrit : On 2009/01/25, at 18:02, João Varela wrote: So you mean that if ( self == [aReceiver class] ) is the same as if ( [self class] == [aReceiver class] ) ? Yes it is. Just a simple snippet to try to help you to understand. We are ok to say

Re: Class introspection [was Re: Forcing allocation of a subclass]

2009-01-25 Thread João Varela
On 2009/01/25, at 18:02, João Varela wrote: So you mean that if ( self == [aReceiver class] ) is the same as if ( [self class] == [aReceiver class] ) ? Yes it is. Just a simple snippet to try to help you to understand. We are ok to say that in a method, self represents the receiver.

Re: Class introspection [was Re: Forcing allocation of a subclass]

2009-01-25 Thread mmalc Crawford
On Jan 25, 2009, at 10:02 AM, João Varela wrote: I think the following comparison is semantically wrong: if ( self == [MyClass class] ) mmalc __