From 78bfd364a9567c8e31d9a48330c8fb20e7b692e8 Mon Sep 17 00:00:00 2001 From: bradex Date: Wed, 3 Jun 2015 19:11:46 +0900 Subject: [PATCH] Fix #92 Crash on iOS 5.1.1 --- Lib/UICKeyChainStore/UICKeyChainStore.m | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Lib/UICKeyChainStore/UICKeyChainStore.m b/Lib/UICKeyChainStore/UICKeyChainStore.m index a3efc9b..003ccb0 100644 --- a/Lib/UICKeyChainStore/UICKeyChainStore.m +++ b/Lib/UICKeyChainStore/UICKeyChainStore.m @@ -906,9 +906,12 @@ + (NSArray *)prettify:(CFTypeRef)itemClass items:(NSArray *)items if (accessible) { item[@"accessibility"] = accessible; } - id synchronizable = attributes[(__bridge id)kSecAttrSynchronizable]; - if (synchronizable) { - item[@"synchronizable"] = synchronizable; + + if (floor(NSFoundationVersionNumber) > floor(993.00)) { // iOS 7+ + id synchronizable = attributes[(__bridge id)kSecAttrSynchronizable]; + if (synchronizable) { + item[@"synchronizable"] = synchronizable; + } } [prettified addObject:item]; @@ -1202,7 +1205,9 @@ - (NSMutableDictionary *)attributesWithKey:(NSString *)key value:(NSData *)value } } - attributes[(__bridge __strong id)kSecAttrSynchronizable] = @(_synchronizable); + if (floor(NSFoundationVersionNumber) > floor(993.00)) { // iOS 7+ + attributes[(__bridge __strong id)kSecAttrSynchronizable] = @(_synchronizable); + } return attributes; }