As John explained, instancetype takes care of it. However, in a 
pre-instancetype world, it still works because your assumption is wrong:

> In order to determine whether the initWithContentsOfFile returns an
> NSDictionary* or an NSArray*

Both actually have an initWithContentsOfFile that returns id (or now 
instancetype). This means they both have the same signature and there's no need 
for the compiler to know whether it's an NSDictionary or an NSArray. You 
explicitly tell the compiler the type when you assign it to a variable of that 
type, but before that, it's only an id for the compiler and it doesn't care.

--
Jonathan


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to