2011-05-08 84 views
1

我正在使用单点触控书写我的第一个iPhone应用程序。我只写了一点代码,突然,它不再编译,我得到这个错误:错误CS1061:AppDelegate不包含GetNativeField的定义

/MyRoute/MainWindow.xib.designer.cs(85,85):错误CS1061:类型xxxx.AppDelegate' does not contain a definition for GetNativeField '没有扩展方法GetNativeField' of type xxx.AppDelegate'可以找到(你是否缺少使用指令或程序集引用?)(CS1061)(xxx)

任何想法,这个错误来自哪里,以及如何解决它?

谢谢! :-D

编辑:添加aditional的信息:

这是主窗口设计器代码:

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; 
     } 

     } 
} 

回答

0

的其他部分类的xxxx.AppDelegate丢失或在不同的名称空间中。它指定基类。

+0

对不起mhutch。哪些其他部分班? – xus 2011-05-10 14:10:22

+0

如果您使用的是默认模板,可能是在Main.c中。 – 2011-05-11 01:10:43

+0

嗨,我想两者都在同一个命名空间中......请看看我在原帖中添加的代码 – xus 2011-05-11 13:11:08

相关问题