• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: observing dealloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: observing dealloc (From: Erik Buck <email@hidden>)
 >Re: observing dealloc (From: Ken Tozier <email@hidden>)
 >Re: observing dealloc (From: Steve Israelson <email@hidden>)
 >Re: observing dealloc (From: Ken Tozier <email@hidden>)
 >Re: observing dealloc (From: Chris Hanson <email@hidden>)
 >Re: observing dealloc (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: observing dealloc
  • Next by Date: Re: CD: Creating a managed object
  • Previous by thread: Re: observing dealloc
  • Next by thread: NSTableColumn 'enabled' binding not in 10.3? Any others?
  • Index(es):
    • Date
    • Thread