I have following structure of objects:
Animal, Dog and Cat. As You expect Dog and Cat are inherited from Animal.
And I\'ve a farm class:
@im
You are missing breaks, that's why your switch isn't working. It should look like this.
switch (type) { case CAT: return [Cat new]; break; case DOG: return [Dog new]; break; default: return [Animal new]; break; }