I am working on MonoTouch binding of an Objective-C application. I referred iOS Binding Walkthrough.
I have generated libraries for i386, ARM and then a universal library. Further, I created a MonoTouch Binding Project. I have generated ApiDefinition using Sharpie and added the universal library generated earlier. Now when I build this project I am getting the following error.
ADClusterAnnotation.g.cs(86,86): Error CS0533:
AnnotationClusterMap.ADClusterAnnotation.Coordinate' hides inherited abstract member MonoTouch.MapKit.MKAnnotation.Coordinate' (CS0533)
Here is the code snippet of ADClusterAnnotation:
@interface ADClusterAnnotation : NSObject <MKAnnotation> {
CLLocationCoordinate2D _coordinates;
}
@property (nonatomic) CLLocationCoordinate2D coordinate;
@end
@synthesize coordinate = _coordinates;
Here is the code snippet from ApiDefinition
[BaseType (typeof (MKAnnotation))]
public partial interface ADClusterAnnotation {
[Export ("coordinate")]
CLLocationCoordinate2D Coordinate { get; set; }
}
So I think we need to change something in ApiDefinition. I tried removing Coordinate from ADClusterAnnotation in the API definition, but then it gives an error that it implements an abstract member. What am I missing with regard to Monotouch binding?
Overriding an abstract member require c# new or override
You can get that to be generated by changing your ApiDefinition to:
[BaseType (typeof (MKAnnotation))]
public partial interface ADClusterAnnotation {
[Export ("coordinate")]
[New]
CLLocationCoordinate2D Coordinate { get; set; }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With