Re: Status of Java Bridge?
Re: Status of Java Bridge?
- Subject: Re: Status of Java Bridge?
- From: Jay Prince <email@hidden>
- Date: Fri, 30 May 2003 10:26:01 -0700
Calling Java from Objective-C is very easy.
Rather than wrapping Objective-C to call it from Java, we've used a
simple trick. We used Interface builder to wire up some controls such
that the outlet was connected to the Java code. The target (of say, a
button) was set to an objective-C class.
Thus you can tell the button to performClick() and the Objective-C
target/selector gets called. This could trigger your code on the
objective-C side to call the java class and ask for the data you want
to move across "the bridge".
Since Interface builder handles this transparently, this was fairly
convenient for light use.
I haven't tried subclassing a simple NSControl, and seeing if when
instantiated by Interface Builder (or specifically, the nib loading
mechanism) you can thus have your own custom bridge-- but I suspect it
might work.
Also, you could use Notifications or Distributed Objects to communicate
across, without wrapping your Objective-C files.
I suspect if you have a whole lot of apis that you want to wrap and
call from Java, that you should probably pick one language or the
other, and settle on it. But if you can't do that, you can still wrap
them, you just have to do it by hand.
Maybe its time for a project to make an open source replacement to
WrapIt.
Jay
_______________________________________________
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.