title: Inheritance from other class in Xcode
body: <p>I am doing an example for Person and PersonChild classes.
  I was wondering why I can get this Int from the Person Class.</p>
  
  <p>//Main</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "Person.h"
  #import "PersonChild.h"
  
  int main(int argc, const char * argv[]){
      @autoreleasepool {
          PersonChild *Ben = [[PersonChild alloc]init];
          Ben.age = 25;  &lt;-- Property 'age' not found on object of type 'PersonChild *'
          [Ben printThing];
      }
      return 0;
  }
  </code></pre>
  
  <p>//Person class</p>
  
  <pre><code>#import "Person.h"
  
  @implementation Person
  @synthesize age, weight;
  
  @end
  </code></pre>
  
  <p>//Person.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface Person : NSObject{
      int age;
  }
  @property int age, weight;
  @end
  </code></pre>
  
  <p>//PersonChild class</p>
  
  <pre><code>#import "PersonChild.h"
  
  @implementation PersonChild
  
  -(void) printThing{
     NSLog(@"%i", age);
  }
  @end
  </code></pre>
  
  <p>//PersonChild.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "Person.h"
  
  @class Person;
  @interface PersonChild : NSObject
  
  -(void) printThing;
  
  @end
  </code></pre>