Re: Class Constants
Re: Class Constants
- Subject: Re: Class Constants
- From: Greg Hulands <email@hidden>
- Date: Mon, 31 May 2004 10:44:06 +1000
static NSDictionary *attributes = nil;
in the method that you need it.
if (!attributes)
{
attributes = [[NSDictionary dictionaryWithContentsOfFile:someFile]
retain];
}
return attributes;
On 31/05/2004, at 9:57 AM, James Stroud wrote:
Hello All,
I would like to make a NSDictionary filled with the same values
available to all instances of a class. (It would not change from
instance to instance, but all instances will need it. I want to read
this dictionary in from a plist, but I think it would be wasteful for
each instance to have its own copy of the dictionary. Its not obvious
to me how I would go about implementing this. Does anyone have any
advice.
Thanks in advance,
James
---------------------------------------------------------
James Stroud
Department of Chemistry
University of Colorado
Boulder, CO 80309-0215, USA
tel: 303-492-4503
www: http://JamesStroud.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.