在向 Storyboard添加一个简单的按钮或组件,然后运行调试后,我收到一条消息,指出存在键值编码问题。如果我清理解决方案,它的构建就可以,但是如果我添加另一个组件,我会再次遇到相同的错误。
最佳答案
看到问题后编辑
问题似乎出现在 Xamarin Studio 上 - 这里是 bug report #15002在 Xamarin 的 Bugzilla 上。我会添加 github repository与示例重现问题。它只发生在设备上,而不发生在模拟器上。
旧答案
将正在运行的实例附加到 AppDelegate
时会出现问题。您的 AppDelegate.cs
文件可能有一个未注册的类。尝试验证您的文件内容是否与此类似:
特别是这部分:
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
完整文件:
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace StoryBoardTables
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
PaintCodeViewController viewController;
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
viewController = new PaintCodeViewController ();
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
return true;
}
}
}
关于ios - 运行 Storyboard 项目时,符合 Monotouch 键值编码标准的崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21256818/