Bug 18831 - Cannot deploy to iOS device: selector 'documentInteractionControllerViewControllerForPreview:'
Summary: Cannot deploy to iOS device: selector 'documentInteractionControllerViewContr...
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.2.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-04-06 11:42 UTC by René Ruppert
Modified: 2014-04-06 11:55 UTC (History)
3 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 FEATURE

Description René Ruppert 2014-04-06 11:42:44 UTC
I'm using VS2013 to deploy my solution (which works fine on the Simulator) to my iPhone 5 with iOS 7.1.

Deployment fails with the following error in the output:

2>error MT4117: The registrar found a signature mismatch in the method 'Test_iOS.Controllers.ItemListController.DocumentInteractionControllerViewControllerForPreview' - the selector 'documentInteractionControllerViewControllerForPreview:' indicates the method takes 1 parameters, while the managed method has 0 parameters.
2>error MT4117: The registrar found a signature mismatch in the method 'Test_iOS.Controllers.ItemListController.DocumentInteractionControllerDidEndPreview' - the selector 'documentInteractionControllerDidEndPreview:' indicates the method takes 1 parameters, while the managed method has 0 parameters.


=== Xamarin Studio ===

Version 4.3.4 (build 0)
Installation UUID: 220dde4a-6e9c-4c80-a89e-6ef72bea0759
Runtime:
	Mono 3.4.0 ((no/d4511ef)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000185

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.iOS ===

Version: 7.2.1.31 (Business Edition)
Hash: dcc652e
Branch: 
Build date: 2014-04-02 17:22:19-0400

=== Xamarin.Android ===

Version: 4.12.3 (Business Edition)
Android SDK: /Users/rene/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Build Information ===

Release ID: 403040000
Git revision: e2e118a56ebf05c9f15eafbf53379bdebded727c
Build date: 2014-03-12 15:39:07-04
Xamarin addins: 9f2eb9aed862e28ca23d2d2f34e22952087e6e4c

=== Operating System ===

Mac OS X 10.9.2
Darwin imacbuero.fritz.box 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 1 Sebastien Pouliot 2014-04-06 11:51:47 UTC
That sounds like a legit error. The new registrars (in 7.2.1) will spot more errors than the old one (ObjC runtime does not complain much - even if those errors can cause much problems at runtime).

> - the selector 'documentInteractionControllerViewControllerForPreview:'
> indicates the method takes 1 parameters, while the managed method has 0
> parameters.

If a selector ends with a ":" then it means the ObjC runtime expects a parameter. If your managed code does not have one then there's the potential for memory corruption. That's what the registrar is telling you.

So either:

* your selector is wrong (there's no parameter and the ":" should not be there); or

* your managed method is wrong (and should have a parameter who's managed type match the native type);


Note: on device the static registrar will run at build time (scanning everything) while, on simulator, the dynamic registrar runs just-in-time (but the error remains).
Comment 2 René Ruppert 2014-04-06 11:55:51 UTC
You're right. I wasn't aware that there is a weak delegate being used. It had a ":" that should not be there.

[Export("documentInteractionControllerViewControllerForPreview:")]
UIViewController DocumentInteractionControllerViewControllerForPreview()