Monotouch绑定

时间:2012-09-26 12:43:51

标签: iphone binding xamarin.ios bugsense

我正在尝试将BugSense绑定到Monotouch。但我有一些问题,现在我会听到有人来检查我的绑定吗?

BugSense标题如下所示:

#define BUGSENSE_LOG(__EXCEPTION, __TAG) [BugSenseCrashController logException:__EXCEPTION withTag:__TAG]

OBJC_EXPORT @interface BugSenseCrashController : NSObject <UIAlertViewDelegate>

+ (BugSenseCrashController *) sharedInstanceWithBugSenseAPIKey:(NSString *)APIKey;

+ (BugSenseCrashController *) sharedInstanceWithBugSenseAPIKey:(NSString *)APIKey 
                                                userDictionary:(NSDictionary *)userDictionary;

+ (BugSenseCrashController *) sharedInstanceWithBugSenseAPIKey:(NSString *)APIKey 
                                                userDictionary:(NSDictionary *)userDictionary
                                               sendImmediately:(BOOL)immediately;

+ (BOOL) logException:(NSException *)exception withTag:(NSString *)tag;

@end

然后我添加了一个绑定项目,并在我的ApiDefinition.cs中写道:

[BaseType (typeof (NSObject))]
interface  BugSenseCrashController 
{
    [Static]
    [Export ("sharedInstanceWithBugSenseAPIKey:")]
    BugSenseCrashController SharedInstanceWithBugSenseAPIKey(String APIKey);

    [Static]
    [Export ("sharedInstanceWithBugSenseAPIKey:userDictionary:")]
BugSenseCrashController SharedInstanceWithBugSenseAPIKey(String APIKey, [NullAllowed] NSDictionary userDictionary);

    [Static]
    [Export ("sharedInstanceWithBugSenseAPIKey:userDictionary:sendImmediately:")]
    BugSenseCrashController SharedInstanceWithBugSenseAPIKey(string APIKey, [NullAllowed] NSDictionary userDictionary, bool immediately);

    [Static]
    [Export ("sharedInstance")]
    BugSenseCrashController SharedInstance();

    [Static]
    [Export ("logException:withTag:")]
    bool LogException (NSException exception, string tag);
}

我的问题是Header中的“UIAlertViewDelegate”。我不能在Monotouch中做“[BaseType(typeof(NSObject))]”。

任何人都可以提供帮助吗?

问题是将BugSense绑定到Monotouch。我创建了一个Monotouch绑定库,从BugSenseiOS.Framework中获取二进制文件,将其命名为bugsense.a并将其添加到绑定项目中。但它不起作用。

我的“LinkWith”:

[assembly: LinkWith ("libBugSense-iOS.a", LinkTarget.ArmV6 | LinkTarget.Thumb | LinkTarget.Simulator, ForceLoad = true, Frameworks="SystemConfiguration", LinkerFlags = "-lz")]

BugSense需要SystemConfiguration.framework和libz.dylib。

链接到BugSense http://www.bugsense.com/docs/ios

1 个答案:

答案 0 :(得分:1)

如果这是一个崩溃记者,请记住,崩溃记者会干扰Mono自己的异常处理,所以即使你绑定它们也不行。