我正在尝试绑定一个库,并且在 .h 文件中有以下定义
@interface FbFAccessoryController : NSObject <EAAccessoryDelegate, NSStreamDelegate> {
id <FbFmobileOneDelegate> _delegate;
BOOL ScannerStarted;
}
@property (nonatomic, assign) id <FbFmobileOneDelegate> delegate;
@property (readonly, nonatomic) BOOL Version1b;
- (BOOL)mobileOneConnected;
@property (readonly, nonatomic) NSNumber *VoltIndex;
@property (readonly, nonatomic) BOOL ScannerStarted;
- (void)startScanner;
- (void)stopScanner;
- (void)checkBattery;
@end
对于代表
@class FbFAccessoryController;
@protocol FbFmobileOneDelegate <NSObject>
@required
- (void) mobileOneAccessoryController:(FbFAccessoryController *)mobileOne didChangeConnectionStatus:(BOOL)connected;
- (void) mobileOneAccessoryController:(FbFAccessoryController *)mobileOne didReceiveData:(NSData *)data;
@optional
- (void) mobileOneAccessoryController:(FbFAccessoryController *)mobileOne didReceiveError:(NSError *)error;
- (void) mobileOneAccessoryController:(FbFAccessoryController *)mobileOne didReceiveScannerStartStop:(BOOL)started;
- (void) mobileOneAccessoryController:(FbFAccessoryController *)mobileOne didReceiveDataSpin:(BOOL)started;
@end
我使用 ObjectiveSharpie 生成绑定,但是当我尝试编译时出现以下错误:
在接口列表中键入MonoTouch.ExternalAccessory.EAAccessoryDelegate' in interface list is not an interface
Type
MonoTouch.Foundation.NSStreamDelegate' 不是接口
Objectiveharpie 生成的代码是:
public partial interface FbFAccessoryController : EAAccessoryDelegate, NSStreamDelegate {
[Export ("delegate", ArgumentSemantic.Assign)]
FbFmobileOneDelegate Delegate { get; set; }
[Static, Export ("sharedController")]
FbFAccessoryController SharedController { get; }
[Export ("Version1b")]
bool Version1b { get; }
[Export ("mobileOneConnected")]
bool MobileOneConnected { get; }
[Export ("VoltIndex")]
NSNumber VoltIndex { get; }
[Export ("ScannerStarted")]
bool ScannerStarted { get; }
[Export ("startScanner")]
void StartScanner ();
[Export ("stopScanner")]
void StopScanner ();
[Export ("checkBattery")]
void CheckBattery ();
}