0

I want to store specific info before adding it to my UITableView

I am accessing the End Users addressbook and getting the

First Name
Last Name
Street Address
City
State
Zip

Then I am using MKReverseGeocoder to get the GPS Coordinates

So I need to store the data from the addressbook and pair it to the GPS Coordinates that I received.

Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177

1 Answers1

1

You can do a NSDictionary (use [NSMutableDictionary][1]) and store it in the [NSUserDefaults][2].

save:

[[NSUserDefaults standardUserDefaults] setObject:yourDictionary forKey:@"AkeyToUseAgainShouldBeAConstant"];

load:

NSDictionary *yourDictionary = [[NSUserDefaults standardUserDefaults] objectForKey:@"AkeyToUseAgainShouldBeAConstant"];

if you need it mutable again (to change the content)

NSMutableDictionary *yourDictionaryMutable = [[[[NSUserDefaults standardUserDefaults] objectForKey:@"AkeyToUseAgainShouldBeAConstant"] mutableCopy] autorelease];
Jonas Schnelli
  • 9,965
  • 3
  • 48
  • 60