- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们的快速桥接 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/
我们的快速桥接 header 导入 AFNetworking,编译并运行良好;但是在调试器中, po 爆发式地提示 AFNetworking 中的几个区域声明 dispatch_queue_t 属性很
我是一名优秀的程序员,十分优秀!