错误CS1061:AppDelegate不包含GetNativeField的定义

时间:2011-05-08 17:50:30

标签: xamarin.ios

我正在使用单声道触控编写我的第一个iPhone应用程序。我只写了一点代码,突然间,它不再编译了,我得到了这个错误:

/MyRoute/MainWindow.xib.designer.cs(85,85):错误CS1061:输入xxxx.AppDelegate' does not contain a definition for GetNativeField'并且找不到扩展方法GetNativeField' of type xxx.AppDelegate'(你错过了吗?) using指令或汇编引用?)(CS1061)(xxx)

知道这个错误来自哪里以及如何解决它?

谢谢! :-D

编辑:添加了附加信息:

这是主要的设计师代码:

namespace GuiaTeleIphone {


    // Base type probably should be MonoTouch.Foundation.NSObject or subclass
    [MonoTouch.Foundation.Register("AppDelegate")]
    public partial class AppDelegate {

        private MonoTouch.UIKit.UIWindow __mt_window;

        #pragma warning disable 0169
        [MonoTouch.Foundation.Connect("window")]
        private MonoTouch.UIKit.UIWindow window {
            get {
                this.__mt_window = ((MonoTouch.UIKit.UIWindow)(this.GetNativeField("window")));
                return this.__mt_window;
            }
            set {
                this.__mt_window = value;
                this.SetNativeField("window", value);
            }
        }
    }
}

这是MAIN.CS:

namespace GuiaTeleIphone
{
    public class Application
    {
        static void Main (string[] args)
        {
            UIApplication.Main (args);
        }
    }

    // The name AppDelegate is referenced in the MainWindow.xib file.
    public partial class AppDelegate : UIApplicationDelegate
    {
        List<RSSChannel> RemoteChannelsData;

        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching (UIApplication app, NSDictionary options)
        {
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            window.MakeKeyAndVisible ();

                        // do things here

            return true;
        }

        }
}

1 个答案:

答案 0 :(得分:0)

xxxx.AppDelegate的另一个部分类缺失或位于不同的命名空间中。它指定基类。