• 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: Java and Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java and Objective-C


  • Subject: Re: Java and Objective-C
  • From: Denis Bohm <email@hidden>
  • Date: Sat, 7 Jun 2008 14:40:00 -0700


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 (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


References: 
 >Learning Cocoa with RubyCocoa (was Regular Expressions) (From: Jose Raul Capablanca <email@hidden>)
 >Re: Learning Cocoa with RubyCocoa (was Regular Expressions) (From: "Felipe Monteiro de Carvalho" <email@hidden>)
 >Java and Objective-C (From: Bill Bumgarner <email@hidden>)
 >Re: Java and Objective-C (From: Denis Bohm <email@hidden>)
 >Re: Java and Objective-C (From: Bill Bumgarner <email@hidden>)
 >Re: Java and Objective-C (From: Denis Bohm <email@hidden>)
 >Re: Java and Objective-C (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Java and Objective-C
  • Next by Date: Re: Java and Objective-C
  • Previous by thread: Re: Java and Objective-C
  • Next by thread: Re: Learning Cocoa with RubyCocoa (was Regular Expressions)
  • Index(es):
    • Date
    • Thread