Bug 1706 - Error updating Objective-C type
Summary: Error updating Objective-C type
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 2.8.1
Hardware: Macintosh Mac OS
: --- critical
Target Milestone: ---
Assignee: Alan McGovern
Depends on:
Reported: 2011-10-26 16:30 UTC by Louis Boux
Modified: 2011-11-08 15:36 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Test Project for "Error updating Objective-C type" (1.46 MB, application/zip)
2011-10-27 14:05 UTC, Louis Boux

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Louis Boux 2011-10-26 16:30:14 UTC
I recently updated to monotouch 5.0, but every time I try to open any .xib from my project (note that this project was created with an older version of MonoDevelop and MonoTouch), it just shows this error and nothing follows : 

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

here's the call stack :

Comment 1 Mikayla Hutchinson [MSFT] 2011-10-27 08:22:47 UTC
That's weird, it looks like it's getting a base class IType from the type database converting it to a type name string, then later is unable to resolve the string back to an IType.

Do you have a sample that we can use to reproduce this? If you can't reduce it to a test case and don't want to share the project publicly, you can mark it as private or send it privately to support@xamarin.com.
Comment 2 Louis Boux 2011-10-27 14:03:31 UTC
I found the cause : 

I made a generic controller inheriting from UIViewController (GenericController<T> : UIViewController), i then derived from that (StringController : GenericController<string>) and now every time i try to open a xib in that project from monodevelop, i get the error on from my first post.

note that GenericController has no xib and that StringController has one.

I'll add a test project.
Comment 3 Louis Boux 2011-10-27 14:05:17 UTC
Created attachment 782 [details]
Test Project for "Error updating Objective-C type"

Try to open any xib file from the project from inside monodevelop and it with won't work.
Comment 4 Louis Boux 2011-10-27 14:14:11 UTC
I reopened my test project and opening xib files seemed to work.

Then i just opened another project, closed it and reopened my test case and it stopped working again. I'm not yet sure what all the conditions are for the bug to occur, but right now i have the project opened and everytime i try to open a xib file, it doesn't work, and it just worked minutes ago, with the exact same project.
Comment 5 Jeffrey Stedfast 2011-11-08 14:32:30 UTC
Thanks Louis, the "switching to another project and then back" trick was useful info. I'm able to reproduce this.

Now I just gotta figure out why...
Comment 6 Jeffrey Stedfast 2011-11-08 15:02:48 UTC
Okay, so... if you add a [Register ("GenericController")] attr to GenericController.cs, it works fine.
Comment 7 Jeffrey Stedfast 2011-11-08 15:36:16 UTC
Okay, got a fix for this. In the code that converts C# types to ObjC types, for the BaseCliType, we need to use type.BaseType.DecroatedFullName instead of just FullName because FullName leaves off generics decorations.