title: Extends class in objective-c
body: <p>I'm trying to learn objective-c and get some problem. I've created class Creature and extend it with Dog class.</p>
  
  <p>But when im calling method state, return result looks like it was called from creature class, not Dog.</p>
  
  <p>Link for github <a href="https://github.com/Kein1945/objective-c-first-step" rel="nofollow">source</a></p>
  
  <p>p.s. If you find anouther bugs and memory leaks points, please report me)</p>
  
  <p>code:</p>
  
  <pre><code>@interface Creature: NSObject
      - (NSString *)state;
  ..
  
  @implementation Creature
  - (NSString *)state
  {
      return [_name stringByAppendingString: ([self isHungry] ? @" is hungry" : @" not hungry")];
  }
  
  // Dog 
  
  @interface Dog: Creature
  ..
  
  @implementation Dog
  - (NSString *)state
  {
      return [[super state] stringByAppendingString: ([self isFriendly] ? @" and friendly" : @" and unfriendly")];
  }
  </code></pre>
  
  <p>And calling method</p>
  
  <pre><code>Dog *creature = [Dog CreatureBorn];
  NSLog([creature state]);
  </code></pre>