Re: Scoping of functions
Re: Scoping of functions
- Subject: Re: Scoping of functions
- From: Ondra Cada <email@hidden>
- Date: Thu, 30 May 2002 00:54:26 +0200
On Thursday, May 30, 2002, at 12:00 , Bill Bumgarner wrote:
As long as you stick to a general rule of 'one class per .h or .m', then
static variables as shown above are, effectively, class variables
Not really. Statics are still globals; class variables would belong to a
particular class. Just make a subclass of your Thingamahover -- it would
share the values contents with its superclass.
I haste to add that quite often it is exactly what you *wanted*, whilst
true class variables -- one specific for each class, non-shared with any
other regardless inheritance -- would not do what you need.
In those rare cases when you *need* class variables, the common approach
is to define a global NSDictionary, use class ids (as NSValues) for keys,
and store real values this way.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.