To create an empty dictionary, [NSMutableDictionary dictionary] or [[NSMutableDictionary alloc] init]?

[NSMutableDictionary dictionary] is the same as [[[NSMutableDictionary alloc] init] autorelease]


for the sake of completeness, some years later we got other shorter way to alloc Dictionary:

NSMutableDictionary* dictionary = @{}.mutableCopy;

The difference is that if you use NSMutableDictionary* myDictionary = [[NSMutableDictionary alloc] init] you will have to later call [myDictionary release] when you're done with it. Otherwise you will leak memory. If you use the other method you don't have to worry about memory management.