• 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: Guidance for Cocoa's steep learning curve
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guidance for Cocoa's steep learning curve


  • Subject: Re: Guidance for Cocoa's steep learning curve
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 15 May 2008 07:59:48 -0700


On 14 May '08, at 10:16 PM, David Wilson wrote:

3) Instance methods (with the -) are virtual functions. Class methods (with the +) are static functions.

Class methods aren't exactly like static functions, because they're still dynamically dispatched and can be overridden by subclasses.


A closer analogy is to think of there being a singleton "class object" for every class (which is what -class returns), and the class methods are instance methods of those class objects. The class objects have an inheritance hierarchy that parallels the class hierarchy, so if B is a subclass of A, B's class object will be a subclas of A's class object.

(For more detail, look up "metaclass"; I'm sure there's an abstruse Wikipedia article about it. The concept goes back to Smalltalk-80, on which Objective-C's runtime model and syntax were based.)

—Jens

PS: In regards to the thread subject, I didn't find Cocoa to have a steep learning curve. I took a training class and was amazed at how easy it was to learn, and to build sophisticated apps with, compared to every other GUI API or framework I'd used.

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: 
 >Re: Guidance for Cocoa's steep learning curve (From: Ricky Sharp <email@hidden>)
 >Re: Guidance for Cocoa's steep learning curve (From: Scott Ribe <email@hidden>)
 >Re: Guidance for Cocoa's steep learning curve (From: "David Wilson" <email@hidden>)

  • Prev by Date: Getting help...
  • Next by Date: Re: Getting help...
  • Previous by thread: Re: Guidance for Cocoa's steep learning curve
  • Next by thread: Re: Guidance for Cocoa's steep learning curve
  • Index(es):
    • Date
    • Thread