• 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
Re: Trying to understand -- please help...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Trying to understand -- please help... (From: Peter Hudson <email@hidden>)
 >Re: Trying to understand -- please help... (From: "I. Savant" <email@hidden>)
 >Re: Trying to understand -- please help... (From: "I. Savant" <email@hidden>)
 >Re: Trying to understand -- please help... (From: Vijay Malhan <email@hidden>)
 >Re: Trying to understand -- please help... (From: "Shawn Erickson" <email@hidden>)
 >Re: Trying to understand -- please help... (From: "Vijay Malhan" <email@hidden>)

  • Prev by Date: Re: Method -fax: in IB's First Responder?
  • Next by Date: Re: Trying to understand -- please help...
  • Previous by thread: Re: Trying to understand -- please help...
  • Next by thread: +initialize (was Re: Trying to understand -- please help...)
  • Index(es):
    • Date
    • Thread