• 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: Cocoa coding style (was Re: Did I reinvent the wheel?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)


  • Subject: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • From: Andrew Merenbach <email@hidden>
  • Date: Fri, 9 May 2008 20:47:16 -0700

I think that Chris Hanson was referring to the following note at the very end of the article:

Situations could arise where you want a singleton instance (created and controlled by the class factory method) but also have the ability to create other instances as needed through allocation and initialization. In these cases, you would not override allocWithZone: and the other methods following it as shown in Listing 2-15.

I'm not supporting either point of view as a "best practice," as I don't use singletons much, but I can see where this misunderstanding may have arisen.


Cheers,
	Andrew

On May 9, 2008, at 8:32 PM, Michael Watson wrote:


And do not override any of the following to implement singletons! - allocWithZone: -copyWithZone: -retain -retainCount -release - autorelease Instead, just add a "+sharedWhatever" class method.


<http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html >


-- m-s

_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
      • From: Michael Watson <email@hidden>
References: 
 >Did I reinvent the wheel? (From: Western Botanicals <email@hidden>)
 >Cocoa coding style (was Re: Did I reinvent the wheel?) (From: Chris Hanson <email@hidden>)
 >Re: Cocoa coding style (was Re: Did I reinvent the wheel?) (From: Michael Watson <email@hidden>)

  • Prev by Date: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • Next by Date: iPhone SDK and IB plug-in link error
  • Previous by thread: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • Next by thread: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • Index(es):
    • Date
    • Thread