In the NSObject Class Reference they talk about an "isa instance variable" which
is initialized to a data structure that describes the class
can someone explain what I should know about this isa instance variable? What is that good for? What does isa mean? Sounds like a norm, like DIN, ISO, etc.; Any idea what that is?
It is used to determine a class's inheritance path. More formally:
When a new object is created, it is allocated memory space and its data in the form of its instance variables are initialised. Every object has at least one instance variable (inherited from NSObject) called isa, which is initialized to refer to the object's class. Through this reference, access is also afforded to classes in the object's inheritance path. - Objective-C GNUstep Base Programming Manual: Objective-C
The name isa comes from the OOP concept of IS-A which is simply a relationship between two objects like this:
A dog IS-A mammal.
A car IS-A vehicle.
So the isa instance variable can be helpful in that it can tell you what IS-A relationships your class has in its inheritance hierarchy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With