On Jun 7, 2008, at 2:08 PM, Bill Bumgarner wrote:
On Jun 7, 2008, at 1:54 PM, Denis Bohm wrote:
That is handled by the Java example above (via the "Object...
args"). A method with any number of arguments can be passed to
registerUndoWithTarget. So you could do something like:
undoManager.registerUndoWithTarget(this, "setFrame", true,
splineStruct);
So, Java *can* do dynamic dispatch, but cannot catch a method
dispatch automatically -- you effectively have to compose the method
invocation manually through a comparatively verbose API.
Thus we have a pattern related gem: If you are coming from Java to
Objective-C, the runtime's ability to easily capture, delay, and
redirect method invocations is a pattern you likely haven't used
before. And it is pervasive throughout the Cocoa frameworks --
Undo, Distributed Objects, Key/Value Observation, Bindings, etc...
all rely upon it.
By easily capture method invocations are you referring to overriding
methodSignatureForSelector and forwardInvocation?
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]