Bug 5119 - Interface builder won't recognise classes derived of iPhoneOSGameView
Summary: Interface builder won't recognise classes derived of iPhoneOSGameView
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 3.0.x
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-05-16 07:54 UTC by Martin Bell
Modified: 2012-05-21 18:54 UTC (History)
4 users (show)

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

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:
Status:
RESOLVED FIXED

Description Martin Bell 2012-05-16 07:54:37 UTC
Adding a custom UIView and setting its class to something derived from iPhoneOSGameView will not work as it does not appear in the custom class list in identity inspector.

An easy way to see this is as follows.


1) Create a new solution and select c#->MonoTouch->iPad->OpenGL Application

2) Click on OpenGLViewController.xib

3) In Xcode, select the view and click on the identity inspector tab. The Custom class should be EAGLView

4) change the class to something else, eg just a plain UIView

5) Try changing it back again. You will see EAGLView is no longer in the list

There is no way to recover other than starting the project from scratch again or fooling IB into detecting your class by temporarily deriving it from UIView, selecting it in IB and then putting the code back as it was.
Comment 1 Mikayla Hutchinson [MSFT] 2012-05-16 15:33:35 UTC
Is there an objective-C header file for EAGLView? If so, what is its base class?
Comment 2 Jeffrey Stedfast 2012-05-16 15:36:50 UTC
MonoTouch needs to decorate it's EAGLView with a [Register] attribute, probably.
Comment 3 Mikayla Hutchinson [MSFT] 2012-05-16 15:50:23 UTC
EAGLView is in the template, not the class libraries, and MD used to have logic to short-circuit though unexported intermediate classes when exporting to Obj-C.
Comment 4 Jeffrey Stedfast 2012-05-21 14:36:30 UTC
The problem appears to be that IType.GetAllBaseTypeDefinitions () is returning a list of types in bottom-up order instead of top-down order.

Mike: can you fix this?
Comment 5 Miguel de Icaza [MSFT] 2012-05-21 14:38:22 UTC
As a workaround, can we just sort those ourselves?
Comment 6 Mikayla Hutchinson [MSFT] 2012-05-21 14:49:40 UTC
In NRefectory it's documented as working that way, which seems unintuitive, and definitely different from the old behaviour. I wonder how many places are being affected by this.
Comment 7 Mike Krüger 2012-05-21 15:41:34 UTC
Where are you using that and why ?
Comment 8 Mikayla Hutchinson [MSFT] 2012-05-21 18:54:30 UTC
Fixed in master and 3.0.x branch.