On Mar 27, 2008, at 2:05 PM, Hamish Allan wrote:
On Thu, Mar 27, 2008 at 8:44 PM, Justin Giboney
<[EMAIL PROTECTED]> wrote:

How can I get a variable that is static to each subclass, but that is
declared in the super class?

In short, you can't. "static" in C means "within the scope of the
source file". Split your subclasses off into their own files, define
your static variables there, give them accessor methods, and use those
accessors in the superclass.

Alternatively, if this isn't practical for some reason, you might consider using an NSMapTable or similar data structure to store your per-class info, keyed by class.

Troy

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to