问题描述
我的设置是:
- MonoDevelop 2.8.5
- MonoTouch 4.0.6
- XCode 4.2
我创建了一个单视图 iphone 项目.在模拟器和设备上构建这个都可以.
I create a Single-view iphone project. Building this works on both simulator and device.
现在我双击 .xib 文件,在 XCode 中添加一个文本字段并创建一个出口.没有写其他代码.
Now I double click the .xib file, add a Textfield in XCode and create an outlet. No other code written.
在模拟器上运行这个效果很好.在任何 iPhone 设备上运行它都会在启动时崩溃.我设法获得以下堆栈跟踪:
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
有人提到 MonotTouch 4 仅适用于 MonoDevelop 2.6.问题是自从模拟器工作以来,我已经在 MD 2.8.5 中编写了很多代码,当我回滚到 MD 2.6 时,项目将无法加载...
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...
抱歉缺少格式,我是 stackoverflow 的新手
Sorry for the missing formatting, I am new in stackoverflow
感谢任何帮助.
主题
Any help is appreciated.
Themos
推荐答案
您在 XIB 文件中有一个出口,该出口未映射到 C# 中控制器中的属性.这就是美妙的 class is not key value coding-compatible
消息所表明的.这是一个链接.
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.
我建议您获取最新的 MonoTouch/MonoDevelop(非测试版)和 XCode,然后查找您拥有的插座并查看哪个插座未正确连接.
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.
如果 XCode 不为你做,你可以手动设置它们,有一个简单的 [Outlet]
属性,你把它放在插座的属性上.查看 *.designer.cs
文件以获取示例.
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.
这篇关于Monotouch 4:应用程序在 iPhone 设备上启动时崩溃,可在模拟器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!