How do you map an interface that derives from two classes in MonoTouch?

I have the following interface definition in an external library

@interface AGSGPS : UIView < CLLocationManagerDelegate >

Usually you define in ApiDefinition.cs as:

[BaseType (typeof (UIView))]
interface AGSGPS : CLLocationManagerDelegate

The problem is that both UIVieware and CLLocationManagerDelegateare classes, and this violates the following code:

class AGSGPS : UIView, CLLocationManagerDelegate

which is illegal in c #

thoughts?

+3
source share
1 answer

You do not need to "display" the object. A type in angle brackets is a protocol, and that means your AGSGPS object accepts this protocol.

Check out the docs here

, , . ApiDefinition, CLLocationManagerDelegate, AGSGPS, :

[BaseType (typeof (UIView))]
interface AGSGPS
{

    [Export("locationManager:didUpdateHeading:")]
    void UpdatedHeading(CLLocationManager lman, CLHeading heading);

    // etc, include all CLLocationManagerDelegate methods
}
+3

All Articles