title: Filter one variable from an NSArray with many instances
body: <p>I'm at the beginning  of Objective-C and I'm clueless about my problem</p>
  
  <p>I have a class and I want to filter from an <code>NSArray</code> that includes different instances of class <code>Employee</code> just one variable of instances, <code>name</code> </p>
  
  <p><em>Employee.h</em></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface Employee : NSObject
  @property NSString *name ;
  @property int age;
  @end
  </code></pre>
  
  <p><em>Employee.m</em></p>
  
  <pre><code>#import "Employee.h"
  
  @implementation Employee
  @synthesize name ;
  @synthesize age;
  @end
  </code></pre>
  
  <p><em>main.m</em></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "Employee.h"
  
  int main(int argc, const char * argv[]) {
      @autoreleasepool {
          Employee *firstEmployee = [[Employee alloc] init];
          [firstEmployee setAge:35];
          [firstEmployee setName:[NSString stringWithFormat:@"George "]];
  
          Employee *secondEmployee = [[Employee alloc] init];
          [secondEmployee setAge:35];
          [secondEmployee setName:[NSString stringWithFormat:@"Ivan "]];
  
          Employee *thirdEmployee = [[Employee alloc] init];
          [thirdEmployee setAge:35];
          [thirddEmployee setName:[NSString stringWithFormat:@"Ivan "]];
  
          NSMutableArray *yesArray =                                                         
          [NSMutableArray arrayWithObjects:firstEmployee, secondEmployee, thirdEmployee, nil];
          int i;
          int count;
          count = [yesArray count];
  
          for (i = 0; i &lt; count; i++){
              NSLog(@"Name of %i is %@", i, [[yesArray objectAtIndex:i] name]);
              NSLog(@"Age of  %i is %i", i, [[yesArray objectAtIndex:i] age]);
              NSPredicate *bPredicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'j'"];
              // I don't know how to access just name
              NSArray *beginWithB = [[yesArray name]  filteredArrayUsingPredicate:bPredicate]; 
           }
      }
      return 0;
  }
  </code></pre>