• 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: +poseAsClass and instance variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: +poseAsClass and instance variables


  • Subject: Re: +poseAsClass and instance variables
  • From: Marco Scheurer <email@hidden>
  • Date: Fri, 22 Feb 2002 17:55:10 +0100

On Friday, February 22, 2002, at 05:33 pm, Darrin Filer wrote:

Is there anyway around the limitation that classes can't have instance variables when posing as another class? For my purposes, categories aren't suitable since I need to ensure that certain methods are overridden.

You can override methods in categories, just not easily use the original implementation. But on the over side, you cannot add instance variables in categories either.

One solution is to store your additional variables in a (static) NSDictionary, using the instance pointer as the key.

Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
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.

  • Follow-Ups:
    • Re: +poseAsClass and instance variables
      • From: Darrin Filer <email@hidden>
References: 
 >+poseAsClass and instance variables (From: Darrin Filer <email@hidden>)

  • Prev by Date: Cocoa Documentation Index (was: Re: Setting up an 'About' window)
  • Next by Date: Re: Cocoa Documentation Index (was: Re: Setting up an 'About' window)
  • Previous by thread: +poseAsClass and instance variables
  • Next by thread: Re: +poseAsClass and instance variables
  • Index(es):
    • Date
    • Thread