title: Searchbar/filtering process using serachbar in IOS objective c
body: <p>Can anyone please help me find out why am i not able to fetch filtered array when searchbar delegate method is called while entering text in searchbar</p>
  
  <p>My <code>textDidChange</code> method for toolbar</p>
  
  <pre><code>-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
       if(searchText.length == 0){
          isFiltered = NO;
       }else{
           isFiltered = YES;
           [filterdArray removeAllObjects];
           for(int i = 0; i &lt; [productArray count]; i++){
                NSRange textRange;
                textRange =[[[[productArray objectAtIndex:i] objectForKey:@"senior_name"] lowercaseString] rangeOfString:[searchText lowercaseString]];
  
                if(textRange.location != NSNotFound){
                    [filterdArray addObject:[productArray objectAtIndex:i]];
                    NSLog(@"filterdArrayyyyyyyy:%@",filterdArray);
                }
           }
       }
  
       [self.residentListTableView reloadData];   
  }
  </code></pre>
  
  <p>this is my <code>productArray</code>,</p>
  
  <pre><code>(
      {
      id = 369;
      "room_no" = 101;
      "senior_name" = Tim;
  },
      {
      id = 388;
      "room_no" = "&lt;null&gt;";
      "senior_name" = res444;
  },
      {
      id = 382;
      "room_no" = "&lt;null&gt;";
      "senior_name" = tt1234;
  },......
  </code></pre>
  
  <p><code>filterarray</code> is returning null,</p>
  
  <p>I want to filter tableview based on "senior_name"</p>
  
  <p>Thank you in advance,</p>