Bug 1794 - View controller code generated from the "Cocoa view with controller" template uses invalid type for View
Summary: View controller code generated from the "Cocoa view with controller" template...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Mac Add-in ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Alan McGovern
Depends on:
Reported: 2011-10-31 11:42 UTC by Marek Habersack
Modified: 2011-11-01 11:33 UTC (History)
1 user (show)

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:

Description Marek Habersack 2011-10-31 11:42:47 UTC
When one adds a new view with a controller, the code generated for the strongly typed View property uses the controller's type in cast while it should use the view's type. Instead of:

//strongly typed view accessor
public new MyViewController View {
get {
	return (MyViewController)base.View;

it should generate

//strongly typed view accessor
public new MyView View {
get {
	return (MyView)base.View;

This happens both in MD master and 2.8.x
Comment 1 Mikayla Hutchinson [MSFT] 2011-11-01 11:33:40 UTC
This was a regression introduced in https://github.com/mono/monodevelop/commit/0f8fcb925285a7142dbbc7ecc5b6b59f5525ce3e

Fixed in master.