Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 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.
Running against an emulator works.
Trying to publish to a real device results in the following error:
MT4117:The registrar found a signature mismatch in the method 'XS_SingleView.XS_SingleViewViewController.TextFieldInput_Changed' - the selector 'TextFieldInput_Changed' indicates the method takes 0 parameters, while the managed method has 1 parameters.
If I manually add ":" to the selector name I can publish to the device but I get a NSInvalidArgumentException when the app runs and the event triggers:
[Action ("TextFieldInput_Changed")] -> [Action ("TextFieldInput_Changed:")]
This was all dune using iPad storyboard.
This is the generated code:
[GeneratedCode ("iOS Designer", "1.0")]
partial void TextFieldInput_Changed (UITextField sender);
There are probably a lot of other instances when the ":" is not added to the action attribute selector name, another example is the UIBarButtonItem's action event.
A workaround is to remove the generated code and do the following:
private void ContinueButton_Action()
private void ContinueButton_Action(UIBarButtonItem sender)
The only problem is that as soon as you make any changes to the storyboard the designer file gets regenerated and the original partial void method is back with the action attribute.
"ContinueButton_Action" is a function with no parameters but 'ContinueButton_Action:' is a function which takes one parameter.
There are two workarounds to achieve what you want:
1) Open the storyboard file in a text editor, search for 'ContinueButton_Action' inside an <action /> declaration and append an ":" to the name. Then the function we are generating will match the selector and iOS will be happy.
2) With Xamarin Studio 5.1+ you can move the declaration from your .designer.cs file into your main cs file and remove the 'UIBarButtonItem sender' parameter. Once there is a function with '[Action("ContinueButton_Action")]' on it, the designer will stop generating one in the .designer.cs file. This way you will have a C# function with no parameters, which is what should happen when your selector does not have a ':' at the end.
From our side we will fix our code generation step to correctly generate either a parameterless function, or a function with one parameter.
This has been fixed already
oops, clicked 'save' too early.
The fix for this was included in 5.1, but there was a bug which makes 5.1 unusable. We've just addressed that bug and will be issuing some new builds once the changes have been QA'ed.