我正在尝试将 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);
}
我的问题是标题中的“UIAlertViewDelegate”。我不能在 Monotouch 中执行“[BaseType (typeof (NSObject))]”。
任何人都可以提供帮助吗?
问题是将 BugSense 绑定到 Monotouch。我创建了一个 Monotouch 绑定库,从 BugSenseiOS.Framework 获取二进制文件,将其命名为 bugsense.a 并将其添加到绑定项目中。但它不起作用。
我的“链接”:
[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