iOS Binding : Bir nechta delegatlarni amalga oshiradigan sinf uchun bog'lanishni qanday yaratish mumkin?

Men majburiy loyihani amalga oshirishga harakat qilyapman, lekin uch xil delegatni amalga oshiradigan keyingi interfeysni qanday bog'lashni bilmayman:

@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-da men quyidagi tarzda bog'ladim, bunda SomeControllerDelegate va CLLocationManagerDelegate ilovalari mavjud emas:

[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; }

}

Ushbu bog'lashni amalga oshirishda men topgan muammo shundaki, interfeys bir nechta sinflardan meros bo'lib, bu ulanishni qanday yaratish kerak


person DATI.Investigation    schedule 20.09.2013    source manba


Javoblar (1)


Agar savol SomeControllerDelegate haqida bo'lsa, siz uni [Model] deb e'lon qilasiz va [BaseType]siz quyidagicha:

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

//...

[BaseType (typeof (NSUrlConnectionDelegate), /*...*/]
interface Integration : SomecontrollerDelegate
{
    ...
}
person Stephane Delcroix    schedule 24.09.2013