Reputation: 4822
I'm trying to use SFHFKeychainUtils, but I can't compile without errors. I have the following at the top of my class:
#import "SFHFKeychainUtils.h"
I use the following in a method:
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];
I then add Security.framework through Targets > Build Phases > Link Binary
Then when I go to build i get the following error:
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)
Which is the same error I got before linking Security.framework. I have cleaned and rebuilt my project but cant think of anything else to try.
Upvotes: 0
Views: 2003
Reputation: 4715
squarefrog,
Make sure you've added the SFHFKeychainUtils.m
to your application target. You can check this by either selecting the file in the left pane of XCode and looking at the "Target Membership" section or by going to Project->Your Target->Build Phases->Compile Sources and checking if the SFHFKeychainUtils.m
is added to the list of files.
Let me know if this helped!
Cheers, Pawel
Upvotes: 2