How to succinctly handle this situation. I'm not properly releasing contactDictionary
in the if
statement...
NSNumber *pIDAsNumber;
...
NSMutableDictionary *contactDictionary = [NSMutableDictionary dictionaryWithDictionary:[defaults dictionaryForKey:kContactDictionary]];
if (!contactDictionary) {
contactDictionary = [[NSMutableDictionary alloc] initWithCapacity:1];
}
[contactDictionary setObject:pIDAsNumber forKey:[myClass.personIDAsNumber stringValue]];
[defaults setObject:contactDictionary forKey:kContactDictionary];