Stephen Hsu Stephen Hsu - 1 year ago 85
Objective-C Question

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

To create an empty dictionary, should I call

[NSMutableDictionary dictionary]
or
[[NSMutableDictionary alloc] init]
?

What's the difference?

Answer Source

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