iOS 10以下都可以真机、模拟器测试,iOS 10及以上只能真机测试
解决办法是: 选择 capabilities 打开 keychain Groups
NSMutableDictionary *usernamepasswordKVPairs = [NSMutableDictionary dictionary];
[usernamepasswordKVPairs setObject:field.text forKey:KEY_PASSWORD];
[CCKeychain save:KEY_USERNAME_PASSWORD data:usernamepasswordKVPairs];
NSMutableDictionary *usernamepasswordKVPairs = (NSMutableDictionary *)[CCKeychain load:KEY_USERNAME_PASSWORD];
NSLog(@"%@",[usernamepasswordKVPairs objectForKey:KEY_PASSWORD]);
[CCKeychain delete:KEY_USERNAME_PASSWORD];