diff options
-rwxr-xr-x | example/common/FXKeychain.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/example/common/FXKeychain.m b/example/common/FXKeychain.m index f0ba73c0..4f8bdb83 100755 --- a/example/common/FXKeychain.m +++ b/example/common/FXKeychain.m @@ -105,14 +105,18 @@ NSAssert(!object || (object && data), @"FXKeychain failed to encode object for key '%@', error: %@", key, error); //delete existing data +#if __IPHONE_4_0 && TARGET_OS_IPHONE + OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query); +#else CFTypeRef result; [query setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnRef]; - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result);//SecItemDelete((__bridge CFDictionaryRef)query); + OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result); if (status == errSecSuccess) { status = SecKeychainItemDelete((SecKeychainItemRef) result); CFRelease(result); } - +#endif + //write data if (data) { |