我正在尝试使用SFHFKeychainUtils,但我无法编译没有错误。我在班上名列前茅:
#import "SFHFKeychainUtils.h"
我在方法中使用以下内容:
NSError *error = nil;
NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey];
[SFHFKeychainUtils storeUsername:[loginData objectForKey:@"email"] andPassword:[loginData objectForKey:@"password"] forServiceName:appName updateExisting:TRUE error:&error];
然后我通过 Targets > Build Phases > Link Binary添加Security.framework
然后,当我去构建时,我收到以下错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SFHFKeychainUtils", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这与我在链接 Security.framework 之前遇到的错误相同。我已经清理并重建了我的项目,但想不出其他可以尝试的方法。