I have a method updateUserPlaceDictionary
that draws text from some text fields and throws it in an NSDictionary. After noticing that all the values for the dictionary were null, i tried manually setting some strings for its keys, like so:
- (void)updatePlaceDictionary {
//Create a dictionary that holds the location data.
[self.placeDictionary setValue:[NSString stringWithFormat:@"155 Bovet Rd"] forKey:@"Street"];
[self.placeDictionary setValue:[NSString stringWithFormat:@"san mateo"] forKey:@"City"];
[self.placeDictionary setValue:[NSString stringWithFormat:@"ca"] forKey:@"State"];
[self.placeDictionary setValue:[NSString stringWithFormat:@"94402"] forKey:@"ZIP"];
NSLog(@"%@, %@, %@, %@", [self.placeDictionary objectForKey:@"Street"],
[self.placeDictionary objectForKey:@"City"],
[self.placeDictionary objectForKey:@"State"],
[self.placeDictionary objectForKey:@"ZIP"]);
}
Here is my declaration of placeDictionary
:
@property NSMutableDictionary* placeDictionary;
Also, i did make sure to synthesize it in the .m file.
I have the method log to the console all the location data that was put into the dictionary but all I get are null values. I have the same exact function in another view controller that works completely fine. Can someone tell me if they see anything improper?