Re: Are polymorphic objects possible?
Re: Are polymorphic objects possible?
- Subject: Re: Are polymorphic objects possible?
- From: Chris Hanson <email@hidden>
- Date: Sat, 2 Nov 2002 01:03:55 -0600
At 5:37 PM +1100 11/2/02, Wade Tregaskis wrote:
Is it possible for an object to change at runtime what it appears to
be, to the rest of the program?
Yes[1]. After all, objects are just responding to messages. You can
respond to arbitrary messages by overriding -[NSObject
methodSignatureForSelector:] and [NSObject -forwardInvocation:].
This is essentially how NSProxy/NSDistantObject works. See the
documentation for -[NSObject forwardInvocation:] for more details.
-- Chris
_______________________________________________
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.