gpt4 book ai didi

c# - 第 3 方库中的 MonoTouch 绑定(bind)通知

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:23:15 27 4
gpt4 key购买 nike

我正在为 IDTech CC 滑动器创建绑定(bind)。一段时间以来,我一直在反对这个问题。我坚持如何订阅第 3 方库引发的事件。具体来说,我需要知道刷卡发生的时间。

//Notification identifiers used with NSNotificationCenter
//physical attachment related
extern NSString * const uniMagAttachmentNotification;
extern NSString * const uniMagDetachmentNotification;
//connection related
extern NSString * const uniMagInsufficientPowerNotification;
extern NSString * const uniMagPoweringNotification;
extern NSString * const uniMagTimeoutNotification;
extern NSString * const uniMagDidConnectNotification;
extern NSString * const uniMagDidDisconnectNotification;
//swipe related
extern NSString * const uniMagSwipeNotification;
extern NSString * const uniMagTimeoutSwipeNotification;
extern NSString * const uniMagDataProcessingNotification;
extern NSString * const uniMagInvalidSwipeNotification;
extern NSString * const uniMagDidReceiveDataNotification;
//command related
extern NSString * const uniMagCmdSendingNotification;
extern NSString * const uniMagCommandTimeoutNotification;
extern NSString * const uniMagDidReceiveCmdNotification;
//misc
extern NSString * const uniMagSystemMessageNotification;

文档说这应该有效:

    [Notification]
[Field ("uniMagAttachmentNotification")]
NSString uniMagAttachmentNotification { get; }

它不编译。

obj/Debug/ios/magTechBinding/uniMag.g.cs(637,95): error CS0117: `MonoTouch.Constants' does not contain a definition for `magTechBindingLibrary'
obj/Debug/ios/magTechBinding/uniMag.g.cs(637,77): error CS1502: The best overloaded method match for `MonoTouch.ObjCRuntime.Dlfcn.dlopen(string, int)' has some invalid arguments
obj/Debug/ios/magTechBinding/uniMag.g.cs(637,77): error CS1503: Argument `#1' cannot convert `object' expression to type `string'

任何想法或帮助将不胜感激!

最佳答案

尝试:

[Field ("uniMagAttachmentNotification", "__Internal")]

第二个参数告诉在哪个库中查找该字段。如果没有生成器,假设您将有一个常量准备就绪。

现在,由于您要链接第 3 方 static (.a) 库,它将成为最终可执行文件的一部分。这就是为什么 __Internal 必须用作库名称(这意味着在主可执行文件内部查找)。

关于c# - 第 3 方库中的 MonoTouch 绑定(bind)通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14467054/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com