Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Problem with ObjC binding project and duplicate generated constructors

$
0
0

Hi,

I'm trying to use an Objective-C class that inherits from UIImageView in my iOS project. I've successfully created the fat binary library, imported it into a Xamarin binding project, and used Objective Sharpie to generate my ApiDefinition.cs. However, it doesn't compile due to the following error:

VectorImageViewBase.g.cs(86,10): error CS0111: A member `VectorImages.VectorImageViewBase.VectorImageViewBase(MonoTouch.Foundation.NSCoder)' is already defined. Rename this member or use different parameter types

This is because the compiler actually generated 2 constructors that have the same signature, here is the original (bogus) one:

[CompilerGenerated] [EditorBrowsable (EditorBrowsableState.Advanced)] [Export ("initWithCoder:")] public VectorImageViewBase (NSCoder coder) : base (NSObjectFlag.Empty) { throw new InvalidOperationException ("Type does not conform to NSCoding"); }

Why would it generate this? The type VectorImageViewBase does conform to NSCoding, in ObjC it looks like this:

@interface VectorImageViewBase : UIImageView

also, it implements the required NSCoding methods. Those methods are present in the generated ApiDefinition.cs as well.

Anyone have any ideas?

Thanks!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>