• 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 Bridge problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Bridge problem


  • Subject: Re: Java Bridge problem
  • From: email@hidden
  • Date: Sat, 13 Apr 2002 14:07:34 -0400

Not alloc-ing the GoogleSearchElement causes the application to crash on launch with signal 11 (SIGSEGV)

Owen Anderson


On Saturday, April 13, 2002, at 02:02 PM, Andreas Monitzer wrote:

On Saturday, April 13, 2002, at 07:39 , email@hidden wrote:

I'm having a problem with the Java Bridge, and was wondering if anybody could help.

<code snippet>
id gResult = [[NSClassFromString(@"com.google.soap.search.GoogleSearchResult") alloc] init];
id gResultMem = [[NSClassFromString(@"com.google.soap.search.GoogleSearchResultElement") alloc] init];
...
gResultMem = [gResult getResultElements];

You're overwriting the pointer, why? I think you shouldn't alloc it first.

</code snippet>

[gResult getResultElements] returns an array of GoogleSearchElement's, but when I try to run this code I get a signal 10 (SIGBUS) error. If I try defining gResultMem as gResultMem[], I get a bad initializer compiler error. Does anybody know what's causing this?

I guess you can't allocate com.google.soap.search.GoogleSearchResultElement (haven't looked into it yet), it might be an abstract class or an interface.
Additionally, Java's arrays aren't bridged to C-arrays, you have to use java.lang.reflect.Array to access them.

andy
--
DigiTunnel Public Beta released, offering full PPTP-support for Mac OS X!
http://www.gracion.com/vpn/
_______________________________________________
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: Java Bridge problem
      • From: email@hidden
References: 
 >Re: Java Bridge problem (From: Andreas Monitzer <email@hidden>)

  • Prev by Date: Re: NSPopUpButton
  • Next by Date: Re: 2 Questions: Dock and Private Frameworks
  • Previous by thread: Re: Java Bridge problem
  • Next by thread: Re: Java Bridge problem
  • Index(es):
    • Date
    • Thread