0

I'm getting -34018 back when using SecItemCopyMatching. I did not find any documentation what this error code means. Maybe somebody can help me. Thanks in advance.

kukudas
  • 4,834
  • 5
  • 44
  • 65
  • 1
    "client has neither application-identifier nor keychain-access-groups entitlements" – trojanfoe Jul 04 '14 at 10:20
  • Interesting thanks. I've noticed that this happens when my App gets killed while in background (e.g. to much memory consumption). When i start the app again i get this error. Have you any idea how to fix this? – kukudas Jul 04 '14 at 10:40

2 Answers2

1

Many (all?) Security framework error codes are defined in SecBase.h, a header file that is part of the Security framework. You can also find this file in Apple's open-source Security framework.

Error code -34018 is defined thus:

errSecMissingEntitlement                 = -34018,    /* A required entitlement isn't present. */
rob mayoff
  • 375,296
  • 67
  • 796
  • 848
0

Try this

 NSString *NSStringFromOSStatus(OSStatus errCode)
    {
        if (errCode == noErr)
            return @"noErr";
        char message[5] = {0};
        *(UInt32*) message = CFSwapInt32HostToBig(errCode);
        return [NSString stringWithCString:message encoding:NSASCIIStringEncoding];
    }
jailani
  • 2,260
  • 2
  • 21
  • 45
  • This is how you should do it: http://stackoverflow.com/questions/2196869/how-do-you-convert-an-iphone-osstatus-code-to-something-useful/23708500#23708500 – trojanfoe Jul 04 '14 at 10:25
  • It's still not as good as my answer, which gives a full textural message, but cannot be included in the product due to using deprecated methods. – trojanfoe Jul 04 '14 at 10:29
  • What are the deprecated methods I used that code and build the project in ios7 sdk it doesn't show any deprecated method? Can you specify that methods? – jailani Jul 04 '14 at 10:42
  • I'm talking about my answer in the linked question - it uses deprecated Carbon methods, and can only run under OSX. However it does produce proper messages, where as the accepted answer in that link, and your answer, just produce meaningless 4-character strings in some cases and nothing useful at all in other cases. – trojanfoe Jul 04 '14 at 10:50