【发布时间】:2015-08-25 05:58:15
【问题描述】:
我想将不带 pod 和源代码的 AFNetworking 添加到我的项目中。我从添加源代码开始,然后关注库。
然后我添加了前缀文件
#import <Availability.h>
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#ifndef __IPHONE_6_0
#warning "This project uses features only available in iPhone SDK 6.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#endif
#else
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <AssertMacros.h>
#import <CoreServices/CoreServices.h>
#endif
#endif
并将前缀文件添加到 Build Settings -> Apple LLVM 6.1 - Language -> Prefix Header。
之后我构建了项目,但出现以下错误:
- 函数“SecItemExport”的隐式声明在 C99 中无效
- 使用未声明的标识符“kSecFormatUnknown” 使用未声明的
- 标识符“kSecItemPemarmour”
它们都在一个文件和行中。 AFSecurity Policy.m,第 31 行。即:
__Require_noErr_Quiet(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out);
当我注释这行不正确的代码时,项目的其余部分就构建完成了。
我应该怎么做以及为什么会出现这些错误?
【问题讨论】:
-
我也在 github 上找到了这个帖子。 github.com/AFNetworking/AFNetworking/issues/2901
标签: ios objective-c iphone afnetworking