• 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: Sharing a class' data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sharing a class' data


  • Subject: Re: Sharing a class' data
  • From: Anthony Arthur <email@hidden>
  • Date: Fri, 7 Jun 2002 09:49:17 -0400

You probably want to define class A in a framework and implement a + sharedInstance method. This method will initialize a new instance only once, on the first request, and each request thereafter will return the same instance as the first. That's the basic algorithm, there are many ways to implement.

-b

On Friday, June 7, 2002, at 08:14 AM, Jesus De Meyer wrote:

Hello,

I wanna make a Cocoa class that is shared in several other classes. But I don't want to have different instances of the class, but rather would like to have its data shared. Basically it comes to having class A shared over other classes but letting class B, C and D reach the data of class A.

Is this possible in Cocoa? Or would it be just easier to make a header file and make a struct?

Thanks,

Jesus
______________________________
Jesus De Meyer
CEO @ E dot software
http://www.edot-software.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Sharing a class' data (From: Jesus De Meyer <email@hidden>)

  • Prev by Date: About the accessibility stuff...
  • Next by Date: Re: Worker threads and UI threads
  • Previous by thread: Sharing a class' data
  • Next by thread: Re: Sharing a class' data
  • Index(es):
    • Date
    • Thread