Themos Piperakis
Themos Piperakis

Reputation: 675

Monotouch 4: App crash on launch on iPhone device, works on simulator

My setup is:

I create a Single-view iphone project. Building this works on both simulator and device.

Now I double click the .xib file, add a Textfield in XCode and create an outlet. No other code written.

Running this on the simulator works perfectly. Running it on any iPhone device crashes on launch. I managed to get the following stack trace:

System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.Debugger.ObjectValueTreeView.SetValues (TreeIter parent, TreeIter it, System.String name, Mono.Debugging.Client.ObjectValue val) [0x0000d] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:640 
  at MonoDevelop.Debugger.ObjectValueTreeView.AppendValue (TreeIter parent, System.String name, Mono.Debugging.Client.ObjectValue val) [0x00034] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:627 
  at MonoDevelop.Debugger.ObjectValueTreeView.Refresh () [0x00091] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:468 
  at MonoDevelop.Debugger.ObjectValueTreeView.AddValue (Mono.Debugging.Client.ObjectValue value) [0x0000c] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:416 
  at MonoDevelop.Debugger.ExceptionCaughtDialog.Fill () [0x00084] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:82 
  at MonoDevelop.Debugger.ExceptionCaughtDialog.<HandleExceptionChanged>m__0 (System.Object , System.EventArgs ) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:63 
  at Gtk.Application+InvokeCB.Invoke () [0x00000] in <filename unknown>:0 
  at GLib.Timeout+TimeoutProxy.Handler () [0x00000] in <filename unknown>:0 

Somebody mentioned that MonotTouch 4 only works with MonoDevelop 2.6. The problem is that I have already written a lot of code in MD 2.8.5 since the simulator was working, and when I roll back to MD 2.6 the project will not load...

Sorry for the missing formatting, I am new in stackoverflow

Any help is appreciated.
Themos

Upvotes: 2

Views: 1367

Answers (1)

jonathanpeppers
jonathanpeppers

Reputation: 26485

You have an outlet in a XIB file that isn't mapped to a property in your controller in C#. This is what the wonderful class is not key value coding-compliant message indicates. Here is a link.

I would recommend getting the latest MonoTouch/MonoDevelop (non-beta) and XCode, then find what outlets you have and see which one is not hooked up properly.

You can manually set them up if XCode won't do it for you, there is a simple [Outlet] attribute you put on properties for outlets. Look at a *.designer.cs file for examples.

Upvotes: 2

Related Questions