0

I would like to read a keychain item through Objective-C, I found and read the Apple Documentation

It shows example code, however after properly linking the required frameworks (SystemConfiguration.framework and Security.framework), it is still not clear to me, how I can make it work.

I am also figuring out how to use SSKeychain Wrapper, but I get unrecognized selector sent to class upon calling it during runtime:

-(IBAction) button:(id)sender
{
    NSArray *keychainAccounts = [[self class] allAccounts];
    NSLog(@"Keychain accounts are: %@", keychainAccounts);
}

Thanks a lot.

Community
  • 1
  • 1
Jeremiah Smith
  • 740
  • 6
  • 17
  • could you edit this question to show the lines of code before "`[[self class] allAccounts]`"? Does "`[self allAccounts]`" work? – Michael Dautermann Dec 28 '13 at 05:35
  • I edited it, thanks for your reply. [self allAccounts] does not work, because it is a class method from SSKeychain. It must have something to do with proper class recognition, because I get "+[PreferencesController allAccounts]: unrecognized selector sent to class" Where + means it is a class and I wonder whether SSKeychain shouldn't appear before allAccounts instead. – Jeremiah Smith Dec 28 '13 at 08:25

0 Answers0