Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Developer documentation (Java Bridge?)

Developer documentation (Java Bridge?)
Thread Tools
Fresh-Faced Recruit
Join Date: Jun 2002
Location: Scottsdale, Arizona
Status: Offline
Reply With Quote
Jun 24, 2002, 10:36 PM
 
I was wondering if anyone here has figured out the Java Bridge
that allows Obj-C to call Java virtually transparently? Specifically,
what are the supported transparent mappings of function arguments?

I figure the basic stuff, like int .. String (confirmed). What I had a hell
of a time with this last weekend is a Java method such as:

fubar.doSomething( String args[] );

If I want to call this from objective-c what is the type of the argument?

[fubar_instance doSomething:<what the hell?>];

I tried all the 'reasonable' types without success. So, I had to alter my
Java code to be non-portable to look like this:

fubar.doSomething( NSArray args );

<rant>
The Apple documentation on this subject as well as many other non-obvious
issues is non-existent (it refers you to stuff from the early 1980's [NextStep x86?]).
I really wish Apple would hire 3 tech writers and put their developer documentation
in order! I thought Apple has $4B in the bank!? Spending $300K on bringing
Dev docs up to par would go a long way. Some software developers might actually
consider writing industrial strength apps for Mac OS X... Unfortunately, all the gains
that one gets using Cocoa/Next is wasted on having to do trial and error (see
above).

Please! Don't tell me about technical support at $195 per incident, not as
long as I see "Description forth coming." in developer documentation.
</rant>

Any feedback welcome.
iCode
     
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Jun 25, 2002, 06:04 AM
 
There's a tutorial about that stuff on <a href="http://www.cocoadevcentral.com/" target="_blank">CocoaDevCentral</a> (the only article in section "Java").

And to answer you question: You have to create the Java array using Java reflection over the bridge. Or use java.util.Vector.
     
iCode  (op)
Fresh-Faced Recruit
Join Date: Jun 2002
Location: Scottsdale, Arizona
Status: Offline
Reply With Quote
Jun 26, 2002, 03:08 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by amonitzer:
<strong>There's a tutorial about that stuff on <a href="http://www.cocoadevcentral.com/" target="_blank">CocoaDevCentral</a> (the only article in section "Java").

And to answer you question: You have to create the Java array using Java reflection over the bridge. Or use java.util.Vector.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Thank you. Vectors I've forgotten about...
iCode
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:39 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2