Re: Trying to understand -- please help...
Re: Trying to understand -- please help...
- Subject: Re: Trying to understand -- please help...
- From: Jens Alfke <email@hidden>
- Date: Wed, 21 May 2008 19:30:24 -0700
On 21 May '08, at 12:14 PM, Vijay Malhan wrote:
If I'm not wrong "self" equivalent of "this" which points to an
instance
var. And it is initialized in - init (instance)method. And if it
fails to
initialize, it's nil. So does "self" even exist when + initialize is
called.
This is a class method, so "self" refers to the class itself.
Objective-C is a more pervasively object-oriented language than C++ or
Java, and classes are objects in their own right. Class methods (the
ones with the "+") are methods defined on the class itself.
For gory details, look up "metaclass" on Wikipedia. The concept goes
back to at least Smalltalk-76. (Fortunately it's not as mind-bendingly
recursive in Obj-C as in Smalltalk, where there is a class
"Metaclass", and the inheritance hierarchy goes into loops!)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden