Oliver Weichhold
Oliver Weichhold

Reputation: 10296

MonoTouch fails to open xib file when associated controller is derived from base class

I've created a UIViewController-derived base view controller which most of my controllers inherit:

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

as soon as a controller derives from this base controller ...

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

attempting to open the .xib associated with the controller results in this error which won't go away through rebuilding, restarting or whatever desperate measure:

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 

The only workaround (which is not really not an option), is to comment out the entire partial class before editing the xib. This is a showstopper.

Does anyone know a real workaround?

Upvotes: 0

Views: 793

Answers (1)

Mikayla Hutchinson
Mikayla Hutchinson

Reputation: 16153

The fix for this bug will be in the next MonoDevelop update.

Upvotes: 1

Related Questions