gpt4 book ai didi

ios - 快速调试器 : OS_OBJECT_HAVE_OBJC_SUPPORT = 0

转载 作者:行者123 更新时间:2023-11-28 05:33:22 24 4
gpt4 key购买 nike

我们的快速桥接 header 导入 AFNetworking,编译并运行良好;但是在调试器中,

po 爆发式地提示 AFNetworking 中的几个区域声明 dispatch_queue_t 属性很强,这在 ios >= 6 中很好,只要你没有明确定义 OS_OBJECT_HAVE_OBJC_SUPPORT 为 0

error: property with 'retain (or strong)' attribute must be of object type
@property (nonatomic, strong) dispatch_queue_t completionQueue;
^

为了证实我的担忧,我将#define OS_OBJECT_HAVE_OBJC_SUPPORT 1 放在桥接 header 中:

error: Error in auto-import:
failed to get module 'App' from AST context:
/Users/user/oDevelop/App/App-Bridging-Header.h:7:9: warning: 'OS_OBJECT_HAVE_OBJC_SUPPORT' macro redefined
#define OS_OBJECT_HAVE_OBJC_SUPPORT 1
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/object.h:58:9: note: previous definition is here
#define OS_OBJECT_HAVE_OBJC_SUPPORT 0

那为什么会这样呢?我现在已经两次验证我们的项目和部署目标是 7.0,Pod 项目和每个 Pod 目标都将部署目标设置为 6.0。我尝试手动将 AFNetworking pod 目标更改为 7.0,当然没有效果。

我还尝试了模拟器 (8.1) 和设备(运行 8.0.2)。

最佳答案

我有完全相同的问题,我想我有一个潜在的解决方案:桥接目前似乎不能很好地处理调度对象(适用于 Swift 1.1、Xcode 6.1 和更早版本)。

从 iOS 6.0 开始,调度对象是 Objective-C 对象(参见 Does ARC support dispatch queues?),因此您可以从

@property (nonatomic, strong) dispatch_queue_t completionQueue;

进入:

@property (nonatomic, strong) id completionQueue;

在对 AFNetworking 中的所有调度对象执行此操作并在控制台中尝试 po 之后,它似乎运行良好。不过,我不知道这可能会给 AFNetworking 带来任何潜在问题。

关于ios - 快速调试器 : OS_OBJECT_HAVE_OBJC_SUPPORT = 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26480581/

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