title: How to filter search within a set of letters in search bar so that each letter typed will reduce the results in objective -c
body: <p>i have implemented a search bar that searching trough an array of countries(presented in a picker view), the problem is that the user need to type the full country name that it will find it and i want him to be able to type even one letter and it will show the first country that starts with that letter and if types another than it sorts even further etc etc. 
  Anyone have any ideas??</p>
  
  <pre><code>for(int x = 0; x &lt; countryTable.count; x++){
  
      NSString *countryName = [[countryTable objectAtIndex:x]objectForKey:@"name"];
  
      if([searchedStr isEqualToString:countryName.lowercaseString]){
  
          [self.picker selectRow:i inComponent:0 animated:YES];
  
          flag.image = [UIImage imageNamed:[[countryTable objectAtIndex:i]objectForKey:@"flag"]];
      }
  }
  </code></pre>