• 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: how to make an object with a single unique instance like NSNull?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: how to make an object with a single unique instance like NSNull?
      • From: "Mike R. Manzano" <email@hidden>
  • Prev by Date: Re: Supporting variable-number of table columns, based on source.
  • Next by Date: Re: NSButtonCell Ignores Button Type
  • Previous by thread: Re: how to make an object with a single unique instance like NSNull?
  • Next by thread: Re: how to make an object with a single unique instance like NSNull?
  • Index(es):
    • Date
    • Thread