• 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: A legitimate argument for calling dealloc directly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A legitimate argument for calling dealloc directly?


  • Subject: Re: A legitimate argument for calling dealloc directly?
  • From: Daniel Jalkut <email@hidden>
  • Date: Tue, 14 Jan 2003 19:25:21 -0800

I wasn't aware of these "method forwarding" facilities. It does in fact look like this might accomplish what I was originally thinking of. Still feels a little weird, so I might try to avoid it, but thank you for pointing this out!

Daniel


On Tuesday, January 14, 2003, at 03:06 PM, Mike Shields wrote:

Daniel,

I just had a brainstorm here. Right now you're subclassing to get the behavior you want, right? well why not try composition instead?

@interface MyClass
{
id myivar1;
[other ivars]...
MyUsedToBeSuperClass* forwarder;
}

- (id) init;
- (void) reinit;

etc.

@end

Then in the implementation use forwarding to forward all unknown messages to the forwarder. This should get you back to where you are now. (read file:///Developer/Documentation/Cocoa/ObjectiveC/ 4objc_runtime_overview/index.html for information on how to do this)

Now as to the reinit problem - when you need to re-init, you can re-init the previously super-class object (release, realloc/init) and then update your own object's internal state to the new values you need.

Does this all make sense?

On Tuesday, January 14, 2003, at 11:30 AM, Daniel Jalkut wrote:

Thanks, you guys. Obviously a mental exercise I should have tried out at least once before speculating on it in public ;) I will find a better way to achieve what I need to do ...

Apart from the immediate core-dump? No ;-)
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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: A legitimate argument for calling dealloc directly?
      • From: Andrew Thompson <email@hidden>
References: 
 >Re: A legitimate argument for calling dealloc directly? (From: Mike Shields <email@hidden>)

  • Prev by Date: [ANN]TDCBTableCells Palette v1.1 released
  • Next by Date: Re: COM on mac
  • Previous by thread: Re: A legitimate argument for calling dealloc directly?
  • Next by thread: Re: A legitimate argument for calling dealloc directly?
  • Index(es):
    • Date
    • Thread