Initialization of NSMutableDictionary Object


#1

I’m referencing the German edition of this book (don’t know if there’re any differences).

Looking at the code I wonder why the author uses different ways of initialization of a NSMutableArray and NSMutableDictionary:

...
NSMutableArray *stocks = [NSMutableArray alloc] init];

NSMutableDictionary *stock;
stock = [NSMutableDictionary dictionary];
...

Why does the author uses the “dictionary” method inherited from NSDictionary instead of alloc/init? Class Reference tells me “This method is declared primarily for use with mutable subclasses of NSDictionary. If you don’t want a temporary object, you can also create an empty dictionary using alloc… and init.” What exactly is the difference regarding “temporarily”? 2nd question: why does Xcode autocomplition not provide this method?

Thanks all