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;
}
}
}
對不起mhutch。哪些其他部分班? – xus 2011-05-10 14:10:22
如果您使用的是默認模板,可能是在Main.c中。 – 2011-05-11 01:10:43
嗨,我想兩者都在同一個命名空間中......請看看我在原帖中添加的代碼 – xus 2011-05-11 13:11:08