Re: how to make an object with a single unique instance like NSNull?
Re: how to make an object with a single unique instance like NSNull?
- Subject: Re: how to make an object with a single unique instance like NSNull?
- From: Matt Neuburg <email@hidden>
- Date: Tue, 29 Mar 2005 10:39:39 -0800
On Tue, 29 Mar 2005 09:42:22 -0500, Johnny Deadman <email@hidden>
said:
>I need to make a version of NSNull for my own purposes (it has to be
>a coredata* object so NSNull won't suffice) but I can't figure out
>NSNull's trick of only having a single unique instance. In other words
>
>[NSNull null]
>
>always returns the same instance of NSNull no matter how many times
>you call it.
>
>How do I do this?
Implement singleton. If those words mean nothing to you, run, do not walk,
to get "Design Patterns" (the book). While you're waiting for it to arrive,
search on "singleton" in the archives and you'll see how to implement it,
since this has been explained many times. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden