In my previous entry, I discussed when id
will be promoted to instancetype
. But now that I’ve explained this, I’d like to explain why you should understand this but not rely on it. Instead, you should use instancetype
directly.
Let me start with this bold statement, then I’ll back up and explain it: Use instancetype
whenever it’s appropriate, which is whenever a class returns an instance of that same class.
Continue reading “Why you should use instancetype instead of id”