我想在将特定信息添加到我的 UITableView 之前存储它
我正在访问最终用户地址簿并获取
First Name
Last Name
Street Address
City
State
Zip
然后我使用 MKReverseGeocoder 来获取 GPS 坐标
所以我需要存储地址簿中的数据并将其与我收到的 GPS 坐标配对。
我想在将特定信息添加到我的 UITableView 之前存储它
我正在访问最终用户地址簿并获取
First Name
Last Name
Street Address
City
State
Zip
然后我使用 MKReverseGeocoder 来获取 GPS 坐标
所以我需要存储地址簿中的数据并将其与我收到的 GPS 坐标配对。
您可以执行NSDictionary
(use [NSMutableDictionary][1]
) 并将其存储在[NSUserDefaults][2]
.
节省:
[[NSUserDefaults standardUserDefaults] setObject:yourDictionary forKey:@"AkeyToUseAgainShouldBeAConstant"];
加载:
NSDictionary *yourDictionary = [[NSUserDefaults standardUserDefaults] objectForKey:@"AkeyToUseAgainShouldBeAConstant"];
如果您需要它再次可变(更改内容)
NSMutableDictionary *yourDictionaryMutable = [[[[NSUserDefaults standardUserDefaults] objectForKey:@"AkeyToUseAgainShouldBeAConstant"] mutableCopy] autorelease];