Monotouch - NSInvalidArgumentException

时间:2011-03-28 19:01:36

标签: xamarin.ios

我有这个错误:

2011-03-28 15:38:07.154 FolderNavigation[264:207] -[Subfolder _setViewDelegate:]: unrecognized selector sent to instance 0x6eaafd0

Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: -[Subfolder _setViewDelegate:]: unrecognized selector sent to instance 0x6eaafd0
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26 
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31 
  at FolderNavigation.Application.Main (System.String[] args) [0x00000] in /Users/claudio/Projects/FolderNavigation/FolderNavigation/Main.cs:16 
Error connecting stdout and stderr (127.0.0.1:10001)

并使用Debug(使用Step Into)跟随de代码

从Main.cs开始:

static void Main (string[] args)
{
    UIApplication.Main (args);
}

Subfolder.xib.cs(下一步进入)

[Export("initWithCoder:")]
public Subfolder (NSCoder coder) : base(coder)
{
    Initialize ();
}

void Initialize ()
{
}

在下一步中,我遇到了这个错误  有人有想法吗?

提前致谢!

1 个答案:

答案 0 :(得分:-1)

这是View还是ViewController?我自动生成的文件有一个public Subfolder() : base("Subfolder", null)构造函数,我在这里看不到。

此外,哪个版本的XCode& MT你在跑吗?