当关联的控制器派生自基类时,MonoTouch无法打开xib文件

时间:2011-11-24 09:45:19

标签: xamarin.ios monodevelop

我创建了一个UIViewController派生的基本视图控制器,我的大多数控制器都继承了这个控制器:

public abstract class ViewModelViewController<T> :
  UIViewController where T : ViewModelBase
{
...
}

一旦控制器派生自此基本控制器......

public partial class MainViewController :
  ViewModelViewController<MainPageViewModel>
{
..
}

尝试打开与控制器关联的.xib会导致此错误,该错误无法通过重建,重新启动或任何绝望措施而消失:

Error updating Objective-C type information. Argument cannot be null.
Parameter name: type.

ArgumentNullException: Argument cannot be null.
Parameter name: type
  at MonoDevelop.Projects.Dom.Parser.ProjectDom+<GetInheritanceTree>c__Iterator33.MoveNext () [0x0023d] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Parser/ProjectDom.cs:164 
  at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.ResolveCliToObjc (MonoDevelop.MacDev.ObjCIntegration.NSObjectTypeInfo type) [0x000fb] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:182 
  at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update () [0x000fe] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:89 
  at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update (Boolean force) [0x0000c] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:66 
  at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateTypes (IProgressMonitor monitor, Boolean force) [0x00034] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:302 

唯一的解决方法(实际上不是一个选项)是在编辑xib之前注释掉整个分部类。这是一个停滞不前。

有谁知道真正的解决方法?

1 个答案:

答案 0 :(得分:1)

this bug的修正将在下一个MonoDevelop更新中。