2013-09-20 106 views
2

我试图做一个结合的项目,但我不知道怎么到下一个接口,它实现了三个不同的代表结合:iOS绑定:如何为实现多个代表的类创建绑定?

@interface Integration : NSObject<NSURLConnectionDelegate, SomeControllerDelegate, 
CLLocationManagerDelegate> 
{ 
    id<VendorIntegrationDelegate> delegate; 
    Information *Information; 
    SomeController * controller; 
} 

@property(nonatomic,assign) id<VendorIntegrationDelegate> delegate; 
@property(nonatomic,strong) Information *Information; 
@property(nonatomic,strong) SomeController *controller; 

@end 

在我做了绑定如下ApiDefinition.cs ,缺乏SomeControllerDelegate的实施和CLLocationManagerDelegate:

[BaseType (typeof (NSUrlConnectionDelegate), Delegates=new string [] { "WeakDelegate" }, 
Events=new Type [] { typeof (VendorIntegrationDelegate)})] 
public partial interface Integration 
{ 
    [Export ("delegate", ArgumentSemantic.Assign), NullAllowed] 
    NSObject WeakDelegate { get; set; } 

    [Wrap("WeakDelegate")] 
    VendorIntegrationDelegate Delegate { get; set; } 

    [Export ("Information", ArgumentSemantic.Retain)] 
    Information Information { get; set; } 

    [Export ("controller", ArgumentSemantic.Retain)] 
    SomeController Controller { get; set; } 

} 

,我发现同时使这种结合是界面从几类继承的问题,如何建立这种结合

回答

1

如果问题是关于SomeControllerDelegate,你将它声明为[Model],没有[BaseType]这样的:

[Model] 
interface SomeControllerDelegate 
{ 
    //... 
} 

//... 

[BaseType (typeof (NSUrlConnectionDelegate), /*...*/] 
interface Integration : SomecontrollerDelegate 
{ 
    ... 
}