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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to