Bug 39607 - MT4109 Failed to compile the generated registrar code. Please file a bug report at
Summary: MT4109 Failed to compile the generated registrar code. Please file a bug repo...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-03-14 18:36 UTC by Andrew
Modified: 2016-03-14 21:29 UTC (History)
2 users (show)

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

Example Project Experiencing the issue (16.18 KB, application/zip)
2016-03-14 18:39 UTC, Andrew

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 Andrew 2016-03-14 18:36:55 UTC
Experiencing this issue only when Deploying to Device (not Emulator) and when particular Main.Storyboard is added to the project (Main.Storyboard in the project attached). Seemingly the issue only happens when the ViewController.Designer.cs contains information about the Switch implemented in the Storyboard.

Any help or additional information would be great. Thanks!
Comment 1 Andrew 2016-03-14 18:39:26 UTC
Created attachment 15398 [details]
Example Project Experiencing the issue
Comment 2 Sebastien Pouliot 2016-03-14 19:22:35 UTC
		UISwitch @switch { get; set; }

^ that's the issue.

Newer version of XI (in alpha now) have a better error message:

> error MT4164: Cannot export the property 'switch' because its selector 'switch' is an Objective-C keyword. Please use a different name.

You need to use a name that does not conflict with ObjC as some glue code needs to be compiled by the static registrar. That's not an issue on the simulator where a dynamic registrar is used (by default).
Comment 3 Andrew 2016-03-14 21:05:13 UTC
Thanks for the info. 

How does one change the name? The @switch is a name auto-generated from the base object, UISwitch, being called a 'Switch'. How do I change that?
Comment 4 Sebastien Pouliot 2016-03-14 21:15:27 UTC

1. open the iOS designer on your Main.storyboard;

2. find your UISwitch named `switch` (e.g. using the Document Outline, since is not visible by default); and 

3. rename it `switchX` (or anything else that is not an ObjC keyword)

4. Save and rebuild.
Comment 5 Andrew 2016-03-14 21:29:16 UTC
Ah, as in the 'Class' name under 'Identity'. 
I feel as though this should be something done already.

Oh well. Thank you for your help.