From: Arno P. <ar...@pu...> - 2010-11-11 16:56:40
|
that is a known issue. The code that XMLVM generates is correct. The problem is that certain classes (such as UIAppication*) are instantiated by Cocoa and Cocoa doesn't know about the __init__*() constructors that were generated by XMLVM. The initialization of 'test' in your example will end up in the default constructor for class Main and since Cocoa doesn't call it, it won't get initialized. This will work perfectly fine for any other class (that is handled by XMLVM). It is just this special case when Cocoa instantiates a Java object. Back then I couldn't think of a solution for this. I'll revisit this with the C backend. Here we might have more hooks to solve this problem. Arno On 11/11/10 7:08 AM, Panayotis Katsaloulis wrote: > there is something missing when variables are initialized outsize the constructor. > > As a minium program to display this error, have a look at this: instead of printing "hello", it prints "null", since this is not initialized. > > > > > package my.testmem; > > import org.xmlvm.iphone.UIApplication; > import org.xmlvm.iphone.UIApplicationDelegate; > > public class Main extends UIApplicationDelegate { > > String test = "hello"; > > @Override > public void applicationDidFinishLaunching(UIApplication app) { > System.out.println(test); > } > > public static void main(String[] args) { > UIApplication.main(args, null, Main.class); > } > } > > > ------------------------------------------------------------------------------ > Centralized Desktop Delivery: Dell and VMware Reference Architecture > Simplifying enterprise desktop deployment and management using > Dell EqualLogic storage and VMware View: A highly scalable, end-to-end > client virtualization framework. Read more! > http://p.sf.net/sfu/dell-eql-dev2dev > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |