Re: Sharing a class' data
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.