Skip to content

Commit

Permalink
Merge pull request #93 from bradex/issues/92
Browse files Browse the repository at this point in the history
Fix #92 Crash on iOS 5.1.1
  • Loading branch information
kishikawakatsumi committed Jun 3, 2015
2 parents 75187b5 + 78bfd36 commit 0efcc65
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Lib/UICKeyChainStore/UICKeyChainStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0efcc65

Please sign in to comment.