0

我有空的 iOS 静态库(空的,意味着 - 我只定义了一个没有任何方法的接口),当我尝试构建它时,我得到一堆错误,例如:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:74:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:120:25: error: expected a type
- (id)initWithIdentity:(SecIdentityRef)identity certificates:(NSArray *)certArray persistence:(NSURLCredentialPersistence) persistence NS_AVAILABLE(10_6, 3_0);
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:130:46: error: expected a type
+ (NSURLCredential *)credentialWithIdentity:(SecIdentityRef)identity certificates:(NSArray *)certArray persistence:(NSURLCredentialPersistence)persistence NS_AVAILABLE(10_6, 3_0);
                                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:137:4: error: expected a type
- (SecIdentityRef)identity;
   ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:155:22: error: expected a type
- (id)initWithTrust:(SecTrustRef)trust NS_AVAILABLE(10_6, 3_0);
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:162:42: error: expected a type
+ (NSURLCredential *)credentialForTrust:(SecTrustRef)trust NS_AVAILABLE(10_6, 3_0);
                                         ^
In file included from /Users/p-kir/Work/SourceRepos/iDev_GIT/Tests/AllTests/AllTests/AllTests-Prefix.pch:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:77:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtectionSpace.h:237:4: error: expected a type
- (SecTrustRef)serverTrust NS_AVAILABLE(10_6, 3_0);

有谁知道这可能是什么原因造成的?谢谢。

4

1 回答 1

0

SecIdentityRefSecTrustRefSecurity.framework. 确保您正在导入正确的头文件:

#import <Security/Security.h>

并将其添加Security.framework到您的项目中。

于 2013-06-21T05:20:45.600 回答