title: iOS - How to access object properties in an array properly?
body: <p><strong>Setup:</strong></p>
  
  <p><code>ViewController</code> holds an <code>MyArray</code> of objects from the <code>PersonClass</code>.
  <code>PersonClass</code> has just two properties: <code>name</code> and <code>age</code>.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>When I want to read out a <code>name</code> property from the first object in <code>MyArray</code> whats the proper way to do this?</p>
  
  <p>Do I have to temporarily create an instance of <code>PersonClass</code> like this?</p>
  
  <pre><code>PersonClass *tmp = [PersonClass alloc] init];
  tmp = [MyArray objectAtIndex:0];
  
  NSLog(@"%@", tmp.name);
  </code></pre>
  
  <p>Or can I refer directly to the <code>properties</code> of the <code>objects</code> in the <code>MyArray</code>?</p>
  
  <p>Something like this:</p>
  
  <pre><code> NSLog(@"%@", [self.contactsArray objectAtIndex:0].name); // not working
  </code></pre>