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 (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/andrew.merenbach%40ucla.edu
This email sent to [EMAIL PROTECTED]
_______________________________________________
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]