it sounds like the categories are not defined for the Cocoa classes. I'm
assuming that you are linking in all files that are contained in
src/xmlvm2objc/compat-lib/*, correct?
If the code you are compiling is just plain Java code, I would suggest
you use the new C backend. Try --target=posix and have a look at the
code. One benefit is that it pulls in cross-compiled versions of Apache
Harmony, so the J2SE API is much more complete than what we have right
now on the Objective-C side.
Arno
On 2/21/11 5:00 AM, Ian Frisbie wrote:
> Hello,
>
> I have been experimenting using XMLVM to generate an iPhone compatible
> library from java source meant to be the API on the Android side. I'm
> not trying to generate a full app for the iPhone using XMLVM, just an
> API library.
>
> I generated the objective C files, built a library using those files and
> your compatability files for objective C. Now I'm trying to use that
> library in a native iPhone application.
>
> My problem is that the implementation categories don't seem to be
> referenced properly as I see two things:
>
> 1 - warning like this:
>
> : warning: incompatible Objective-C types 'struct java_lang_String *',
> expected 'struct java_lang_String *' when passing argument 1 of
> '__init_com_newsdart_client_NDApi___java_lang_String:' from distinct
> Objective-C type
>
>
> 2 - runtime selector exception on this line in the generated code for
> one of my classes:
>
>
> [((java_lang_Object*) _r2.o) __init_java_lang_Object__];
>
>
> The object it is operating on is an object I instantiated in the native
> iPhone code using:
>
> [[class alloc] init]
>
> This class had a constructor initializer of a String object in the
> original java code. It was translated into the init call you see in #1
> above. The code above in #2 is near the top of that function.
>
> It seems that for some reason the object that I'm creating is created
> using the native NSObject, and not the NSObject modified using
> categories by java_lang_Object. I'm confused as to how I could control
> this as the steps I went through were pretty straight forward.
>
> Is there some compiler option needed for implementation categories to
> work correctly? (either for the library I'm creating or native
> application using the library?
>
> I think my problem must be pretty basic.
>
> Best Regards,
>
> Ian
>
>
> --
> Ian D. Frisbie
>
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
>
>
>
> _______________________________________________
> xmlvm-users mailing list
> xml...@li...
> https://lists.sourceforge.net/lists/listinfo/xmlvm-users
|