抛出了MonoTouch.Foundation.MonoTouchException抛出的Objective-C异常。名称:NSInternalInconsistencyException [英] MonoTouch.Foundation.MonoTouchException has been thrown Objective-C exception thrown. Name: NSInternalInconsistencyException

查看:1296
本文介绍了抛出了MonoTouch.Foundation.MonoTouchException抛出的Objective-C异常。名称:NSInternalInconsistencyException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎得到这个问题,每当我跑在我的Xamarin iOS应用程序。

I seem to be getting this issue whenever I run my iOS app within Xamarin.

MonoTouch.Foundation.MonoTouchException has been thrown

Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: ’NSBundle ... (loaded)' with name ‘RouteMeViewController'

我试图替换使用,我是给工作在一个应用程序中的目标C函数库和活页夹有一个RouteMeViewController GoogleMapsViewController。我的AppDelegate看起来是这样的:

I am trying to replace a GoogleMapsViewController with a RouteMeViewController using the Objective C library and Binder in an app that I was given to work on. My AppDelegate looks like this:

namespace ExampleApp.iOS
{
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{

    UIWindow window;
    RouteMeViewController viewController;

    public override bool FinishedLaunching (UIApplication app, NSDictionary options)
    {
        window = new UIWindow (UIScreen.MainScreen.Bounds);

        viewController = new RouteMeViewController ();
        window.RootViewController = viewController;
        window.MakeKeyAndVisible ();

        return true;
    }

}



RouteMeViewController

RouteMeViewController

namespace ExampleApp.iOS
{
public partial class RouteMeViewController : UIViewController
{

    RMMapView MapView { get; set; }

    public RouteMeViewController () : base ("RouteMeViewController", null)
    {
    }

    public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();

        MapView = new RMMapView(View.Frame, new RMOpenStreetMapSource().Handle);
        MapView.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;

        if (UIScreen.MainScreen.Scale > 1.0)
            MapView.AdjustTilesForRetinaDisplay = true;

        Add (MapView);
    }

}



}

}

任何帮助或指导是非常赞赏,谢谢!

Any help or direction is much appreciated, thank you!

推荐答案

看来你缺少解决方案的资源,设计师的文件。即使你以编程方式创建控件和意见,你需要在那里他们需要绘制的设计文件,即使它只是一个空的设计文件。对于iOS,你可以使用的XCode了点。您可以创建一个的.xib扩展名的文件。他们将在设备上进行编译,生成的文件的扩展笔尖。确保该文件的.xib目标是项目的正确的viewController,否则你还是会得到错误。

It seems you're missing a designer file in the resources of your solution. Even if you programmatically create controls and views, you need a designer file where they need to be drawn in, even if it's just an empty designer file. For IOS, you can use XCode for that. You can create files with the .xib extension. They will be compiled on your device, and the resulting file has the extension .nib. Make sure the target of the .xib file is the correct viewController of your project, else you'll still get the error.

我希望这有助于。祝你好运!

I hope this helps. Good luck!

这篇关于抛出了MonoTouch.Foundation.MonoTouchException抛出的Objective-C异常。名称:NSInternalInconsistencyException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆