title: Display all name that search when we type the first letter for iPhone
body: <p>I want to search all names that start with a particular letter, that means when I type one character in search bar it will show all names that start with that character but unfortunately it also shows the names that contain this character.I want to show only those names that start with a particular character that I type in search bar . Please show me the solution.</p>
  
  <pre><code> - (void)searchBar:(UISearchBar *)searchBars textDidChange:(NSString *)search
   {
  
   if(search.length == 0)
   {
      isFiltered = FALSE;
   } 
   else{
  
      isFiltered=true;
      itemData =[[NSMutableArray alloc] init];
  
      for (Item *itemsearch in listOfItemForStock) {
  
          NSString *stringId = [NSString stringWithFormat:@"%i",itemsearch.iditem];
          NSString *stringName = [NSString stringWithFormat:@"%@",itemsearch.name];
          NSRange idRange = [stringId rangeOfString:search options:(NSCaseInsensitiveSearch)];
          NSRange nameRange = [stringName rangeOfString:search options:(NSCaseInsensitiveSearch)];
  
          if(idRange.location!=NSNotFound || nameRange.location != NSNotFound){
  
              [self.itemData addObject:itemsearch];
          }
      }
  }    
  
  [self.tableView reloadData];
  </code></pre>
  
  <p>}</p>