From 30acf11e51314678439575ac7a6364542cadf1aa Mon Sep 17 00:00:00 2001 From: Mark Danks Date: Wed, 28 May 2014 12:20:12 +0100 Subject: [PATCH] Fixes build failure with SDKs lower than 10.9. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As `kSecAttrAccessible` isn’t available until 10.9 or iOS 4.0. --- AFOAuth2Client/AFOAuth2Client.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AFOAuth2Client/AFOAuth2Client.m b/AFOAuth2Client/AFOAuth2Client.m index db7a1fda..4ac3e900 100644 --- a/AFOAuth2Client/AFOAuth2Client.m +++ b/AFOAuth2Client/AFOAuth2Client.m @@ -297,9 +297,11 @@ + (BOOL)storeCredential:(AFOAuthCredential *)credential NSData *data = [NSKeyedArchiver archivedDataWithRootObject:credential]; [updateDictionary setObject:data forKey:(__bridge id)kSecValueData]; - if( securityAccessibility ) +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 43000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) + if( securityAccessibility && &kSecAttrAccessible != NULL ) [updateDictionary setObject:securityAccessibility forKey:(__bridge id)kSecAttrAccessible]; - +#endif + OSStatus status; BOOL exists = ([self retrieveCredentialWithIdentifier:identifier] != nil);