Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments
Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments
- Subject: Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments
- From: James Montgomerie <email@hidden>
- Date: Tue, 27 May 2003 19:32:04 -0700
No-one's replied, so even though It's been a while since I used any of
this, and I'm replying from memory, hopefully this'll be helpful:
On Monday, May 26, 2003, at 03:28 pm, Marc Liyanage wrote:
I read the excellent intro to the ObjC/Java bridge at
http://cocoadevcentral.com/articles/000024.php as well as Apple's docs
about this.
...
My problem is that the transform method takes two arguments. Now, the
Apple docs say that
transform:streamSourceXml dummy:streamResult
will be translated to
transform(streamSourceXml, streamResult);
which is what I want.
...
No matter what I try, the selector is not recognized. I'm pretty sure
the org/apache/xalan/transformer/TransformerImpl class has this
method, I checked the docs as well as the actual binary with "javap".
For fun I tried [transformer transform:streamSourceXml:streamResult];
...
Is there something I can do about this? How can I call this method?
I think you need "[transformer transform:streamSourceXml
:streamResult]" (note the space). Arguments past the first one have no
name, and if you provide one, it won't work (despite what the docs
say). If you still get null pointer exceptions, it's probable that
you've got errors in your code. Remember that on the Obj-C side of the
bridge, normal Cocoa reference counting rules apply to Java objects.
The Java garbage collector doesn't know what you're doing, so if you
don't retain what you need it will be garbage-collected away on the
Java side.
Do I have to write some nice headers to declare the methods?
Writing headers will help to avoid compile-time warnings, but they're
not necessary.
Jamie.
_______________________________________________
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.