Re: observing dealloc
Re: observing dealloc
- Subject: Re: observing dealloc
- From: Chris Hanson <email@hidden>
- Date: Mon, 28 May 2007 21:47:24 -0700
On May 28, 2007, at 9:08 PM, Ken Tozier wrote:
Let me see if I have this right. Given two classes "MyBaseClass" and
MySubClass
[snip - it'd be helpful if you wrote your code a little more
compactly, and didn't depend on particular tab widths]
MyBaseClass *a = [[MyBaseClass alloc] init];
MySubClass *b = [[MySubClass alloc] init];
The "gGlobals" variable for "a" would be distinct from the
"gGlobals" for "b" correct?
That's exactly the opposite of what I was saying. The implementation
you've given is a way to have class variables, which are shared among
subclasses. What I was trying to point out is that you should be
careful about how you implement this to ensure that what you implement
-- if you do so at all -- really matches the behavior you want.
In general, most Objective-C code has little enough need for either
class variables *or* class instance variables that they're implemented
individually on a case-by-case basis, rather than via a generic
pattern like you've described.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden