• 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: Convenience initialisers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convenience initialisers


  • Subject: Re: Convenience initialisers
  • From: Dimitri Bouniol <email@hidden>
  • Date: Sun, 05 Jul 2009 11:01:21 -0700

My mistake haha. <Reviews more Objective-C>
I guess you learn something new everyday.

On Jul 5, 2009, at 10:55 AM, Chris Hanson wrote:

You absolutely can (and should!) send +alloc to self in a class method like this. In a class method, "self" represents the class, not an instance of the class.

This is one reason it's important not to refer to class methods as "static methods," as less dynamic languages do. In Objective-C, all method dispatch is dynamic, even to classes, and is subject to override.

 -- Chris

On Jul 5, 2009, at 10:47 AM, Dimitri Bouniol <email@hidden> wrote:

You can't tell 'self' to be allocated.
_______________________________________________

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: 
 >Convenience initialisers (From: DKJ <email@hidden>)
 >Re: Convenience initialisers (From: Dimitri Bouniol <email@hidden>)
 >Re: Convenience initialisers (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Convenience initialisers
  • Next by Date: Re: Convenience initialisers
  • Previous by thread: Re: Convenience initialisers
  • Next by thread: Re: Convenience initialisers
  • Index(es):
    • Date
    • Thread