• 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: 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

  • Follow-Ups:
    • Re: Java and Objective-C
      • From: Denis Bohm <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>)

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