Re: Java Bridge problem
Re: Java Bridge problem
- Subject: Re: Java Bridge problem
- From: Andreas Monitzer <email@hidden>
- Date: Sat, 13 Apr 2002 20:02:47 +0200
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.