views:

75

answers:

1

Could someone please clarify for me the semantic difference between these two:

self.foo = [NSMutableDictionary dictionaryWithCapacity:theCapacity];

self.foo = [[[NSMutableDictionary alloc] initWithCapacity:theCapacity] autorelease];

Are the interchangable? If not how exactly do they differ.

Thanks in advance.

Cheers, Doug

+3  A: 

In this case they are totally interchangeable.

dictionaryWithCapacity:theCapacity is just a shortcut

nico