初始化Instance,创建环境。
NSMutableSet *mInternalKeySet = [NSMutableSet setWithObjects:KClientId,nil];
NSMutableSet *mPersonalKeySet = [NSMutableSet setWithObjects:KIdCardNumber, nil];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
_dicInternalData = [NSMutableDictionary dictionaryWithDictionary:[userDefaults objectForKey:KeyInternalData]];
_dicPersonalInfo = [NSMutableDictionary dictionaryWithDictionary:[userDefaults objectForKey:KeyPersonalInfo]];
if ((nil == _dicPersonalInfo)) {
_dicPersonalInfo = [[NSMutableDictionary alloc]init];
}
if ((nil == _dicInternalData)) {
_dicInternalData = [[NSMutableDictionary alloc]init];
}
使用存储 如下,
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[_dicInternalData setObject:wSaveStr forKey:otaKey];
[userDefaults setObject:_dicInternalDatay forKey:KeyInternalData];
[userDefaults synchronize];
获取同理,可参照API。