Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #60 from Eugene-Gubin/master
Browse files Browse the repository at this point in the history
Fixed crash on iOS prior 7.
  • Loading branch information
soffes committed Mar 6, 2014
2 parents 0459ab3 + 94bfdb5 commit 647fc2d
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions SSKeychain/SSKeychainQuery.m
Expand Up @@ -8,6 +8,7 @@

#import "SSKeychainQuery.h"
#import "SSKeychain.h"
#import <UIKit/UIKit.h>

@implementation SSKeychainQuery

Expand Down Expand Up @@ -180,26 +181,26 @@ - (NSMutableDictionary *)query {
#endif
#endif

#ifdef SSKEYCHAIN_SYNCHRONIZABLE_AVAILABLE
id value;

switch (self.synchronizationMode) {
case SSKeychainQuerySynchronizationModeNo: {
value = @NO;
break;
}
case SSKeychainQuerySynchronizationModeYes: {
value = @YES;
break;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
id value;

switch (self.synchronizationMode) {
case SSKeychainQuerySynchronizationModeNo: {
value = @NO;
break;
}
case SSKeychainQuerySynchronizationModeYes: {
value = @YES;
break;
}
case SSKeychainQuerySynchronizationModeAny: {
value = (__bridge id)(kSecAttrSynchronizableAny);
break;
}
}

[dictionary setObject:value forKey:(__bridge id)(kSecAttrSynchronizable)];
}
case SSKeychainQuerySynchronizationModeAny: {
value = (__bridge id)(kSecAttrSynchronizableAny);
break;
}
}

[dictionary setObject:value forKey:(__bridge id)(kSecAttrSynchronizable)];
#endif

return dictionary;
}
Expand Down

0 comments on commit 647fc2d

Please sign in to comment.