使用第三方库AFNetworking时遇到的问题

  在AFSecurityPolicy.m这个类中,会报这样三个错误

  1. Use of undeclared identifier 'kSecFormatUnknown'

  2. Use of undeclared identifier 'kSecItemPemArmour'

  3. Implicit declaration of function 'SecItemExport' is invalid in C99

  网上搜索后,发现只要在.pch文件中加入如下代码即可:

#ifndef TARGET_OS_IOS

#define TARGET_OS_IOS TARGET_OS_IPHONE

#endif

#ifndef TARGET_OS_WATCH

#define TARGET_OS_WATCH 0

#endif

  而目前的Xcode 6版本已经没有.pch文件了,需要自己手动创建,具体的步骤可以参见另外一篇:Xcode6为什么干掉pch(Precompile Prefix Header)&如何添加pch文件

原文地址:https://www.cnblogs.com/ljios/p/4817289.html