Re: Java and Objective-C
Re: Java and Objective-C
- Subject: Re: Java and Objective-C
- From: Bill Bumgarner <email@hidden>
- Date: Sat, 07 Jun 2008 14:08:46 -0700
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.
b.bum
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden