This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
# | |
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 | |
# | |
# Version 2.82 | |
# | |
# Latest Change: | |
# - MORE tweaks to get the iOS 10+ and 9- working | |
# - Support iOS 10+ | |
# - Corrected typo for iOS 1-10+ (thanks @stuikomma) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)saveToKeychain { | |
NSData *passwordData = [@"myPassword" dataUsingEncoding:NSUTF8StringEncoding]; | |
/* Try to save to the keychain */ | |
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:3]; | |
[dictionary setObject:(__bridge id)kSecClassGenericPassword forKey:(__bridge id)kSecClass]; | |
[dictionary setObject:@"myService" forKey:(__bridge id)kSecAttrService]; | |
[dictionary setObject:@"myAccount" forKey:(__bridge id)kSecAttrAccount]; | |
/* Use the kSecAttrAccessGroupToken access group constant*/ | |
[dictionary setObject:(__bridge NSString * _Nullable)(kSecAttrAccessGroupToken) forKey:(__bridge id)kSecAttrAccessGroup]; | |
[dictionary setObject:passwordData forKey:(__bridge id)kSecValueData]; |