Why does my iOS 9 app fail with: System.Exception: Failed to marshal the Objective-C object?

PDF for offline use

Let us know how you feel about this

Translation Quality


You may see an error of this form:

System.Exception: Failed to marshal the Objective-C object ... Could not find an existing managed instance for this object ...

API changes in iOS 9 require that a callback constructor be used when calling unmanaged code, as the underlying API now expects it. Use the following line to add the callback constructor to the class:

public foo (IntPtr handle) : base (handle)

Next Steps

For further assistance, to contact us, or if this issue remains even after utilizing the above information, please see What support options are available for Xamarin? for information on contact options, suggestions, as well as how to file a new bug if needed.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.