• 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: Need Help with Obj-C -> Java bridge method calls with multiple arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Thu, 29 May 2003 16:48:54 -0700

On Thursday, May 29, 2003, at 4:30 PM, Marc Liyanage wrote:

Hi there,

On Mittwoch, Mai 28, 2003, at 04:32 Uhr, James Montgomerie wrote:

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:

Thanks a lot...


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).

Seems I already used that form in my second example, and seems this, along with the bug in the Apple docs, was mentioned in that article I referenced. The author already told me about it...

Good - your second example had no whitespace before the second colon though, hence my comment (perhaps this is not needed?)


If you still get null pointer exceptions, it's probable that you've got errors in your code.

I thought so too at first, but maybe it's a problem in the Xalan Java library I used: I left my code untouched but switched the library from Xalan to Saxon, another XSLT processor, and my code worked immediately and flawlessly...

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.

Yes, but I used the alloc/init and the newWithSignature forms to create new instances, and I think these all start with a ref count of 1, so I don't think that was the problem.

It was the "id transformer = [transformerFactory newTransformer:streamSourceXslt];" line that was freaking me out - you weren't retaining the returned transformer (though I don't know that API, so maybe you don't need to because there's a reference to it somewhere else).

Thanks for the confirmation about the method call syntax :-)

Well, I'm glad at least something was useful :-)

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.

  • Follow-Ups:
    • Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments
      • From: Marc Liyanage <email@hidden>
References: 
 >Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments (From: Marc Liyanage <email@hidden>)

  • Prev by Date: Re: port number for NSSocketPort
  • Next by Date: Re: Getting Application Path
  • Previous by thread: Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments
  • Next by thread: Re: Need Help with Obj-C -> Java bridge method calls with multiple arguments
  • Index(es):
    • Date
    • Thread