title: Filter array by first letter of string property
body: <p>I have an <code>NSArray</code> with objects that have a <code>name</code> property.</p>
  
  <p>I would like filter the array by <code>name</code> </p>
  
  <pre><code>    NSString *alphabet = [agencyIndex objectAtIndex:indexPath.section];
      //---get all states beginning with the letter---
      NSPredicate *predicate =
      [NSPredicate predicateWithFormat:@"SELF beginswith[c] %@", alphabet];
      NSMutableArray *listSimpl = [[NSMutableArray alloc] init];
      for (int i=0; i&lt;[[Database sharedDatabase].agents count]; i++) {
          Town *_town = [[Database sharedDatabase].agents objectAtIndex:i];
          [listSimpl addObject:_town];
      }
      NSArray *states = [listSimpl filteredArrayUsingPredicate:predicate];
  </code></pre>
  
  <p>But I get an error - "Can't do a substring operation with something that isn't a string (lhs = &lt;1, Arrow> rhs = A)"</p>
  
  <p>How can I do this?  I would like to filter the array for the first letter in <code>name</code> being 'A'.</p>