Re: A legitimate argument for calling dealloc directly?
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.