How can I store an uninitialized object in an NSDictionary
?
I think I would do it like this, but I’m not certain that it’s a good approach:
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:
[MyObject1 alloc], @"myObject1",
[MyObject2 alloc], @"myObject2"
, nil];
MyObject1 *object = [dict objectForKey:@"myObject1"];
[object init];
Any help would be appreciated.