title: Search an array of dictionaries for string
body: <p>I have been beating my head agains the wall on this one all day. I am new to Objective C and I know I am just making a stupid mistake so I would be really grateful for the help.</p>
  
  <p>I have a an array loaded from a plist file of that contains a company directory. It includes the persons first name(fname), last names(lname), extention, phone number, title and department. The table view loads just fine, the object passes to the detail view without any issues, I have the search bar set up to filter a copy of the primary array, but I can't properly figure out how to search the array for the text entered into the bar. It really only needs to shearch the first name, last name, and while no necessary it would be cool to search the extension. All of this information appears in the cell like this, "John Appleseed" and the extension is in the subtitle below. This is the code I currently DON'T have working for the searchBar textDidChange method.</p>
  
  <pre><code>-(void) searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
  if ([searchText length] == 0) {
      [filteredList removeAllObjects];
      [filteredList addObjectsFromArray:phoneListOriginal];
      NSLog(@"no change");
  } else {
      savedSearchTerm = searchText;
  
     [filteredList removeAllObjects];
      for (NSDictionary *dict in phoneListOriginal) {
          for (NSString *testString in dict) {
              NSRange r = [testString rangeOfString:searchText options:NSCaseInsensitiveSearch];            
              if (r.location != NSNotFound) {
              [filteredList addObject:dict];
          }
  
  
          }
      }
      NSLog(@"%@",savedSearchTerm);
  }
  [self.tableView reloadData];
  </code></pre>
  
  <p>}</p>
  
  <p>Is there a good way to search an array of dictionaries like this? I'm about to pull my hair out and I have a sneaking suspicion that I am just not seeing something really obvious.</p>