From: Joseph R. F. <ruk...@op...> - 2009-10-08 00:58:01
|
Hi, I was trying to play with xmlvm and see it working porting an android app to iphone. I wrote this simple android app which runs ok in the android emulator. package com.home.imageviewer; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.AbsoluteLayout; import android.widget.ImageView; import android.widget.LinearLayout; public class ImageViewer extends Activity { /** Called when the activity is first created. */ @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AbsoluteLayout layout = new AbsoluteLayout(this); layout.setLayoutParams(new LayoutParams (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); ImageView viewer = new ImageView(this); viewer.setImageResource(R.drawable.cat); layout.addView(viewer, new AbsoluteLayout.LayoutParams (AbsoluteLayout.LayoutParams.WRAP_CONTENT, AbsoluteLayout.LayoutParams.WRAP_CONTENT, 0, 60)); setContentView(layout); } } I think cross compiled it using xmlvm with android-on-iphone option following the instructions in manual.pdf. Also I think there should be some instructions for the newbies on how to add iphone frameworks to the project and also which ones are needed. As I had to spend some time to figure this out myself as it wasn't in the manual.pdf when following the steps. It successfully create iphone files. Well no errors were reported. I then ran make in this directory which compiled the iphone files and launched the iphone simulator. However when I run my application, it opens up a black window and then automatically shuts down. I ran it via xcode and this is what I get in the IDE 2009-10-08 09:43:21.988 test[6829:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** - [NSPlaceholderMutableString initWithString:]: nil argument' 2009-10-08 09:43:21.990 test[6829:207] Stack: ( 36152411, 2438119241, 36236347, 36236186, 588736, 145543, 42424, 41261, 41810, 9058 ) (gdb) Any ideas? I was careful to write an app using only the features I was confident were supported by the android compat library. Regards, Rukshan Fonseka. |