title: How to dismiss the Keyboard using UIsearchBar Delegate methods? i tried every method but no use.
body: <p>Hi i am using a UIsearchBar in my app, i tried all methods in UISearchBar Delegate to dismiss the keyboard but no use. could anyone help me out.</p>
  
  <p>some codes i tried</p>
  
  <p>1.</p>
  
  <pre><code>-(void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
  {
      [searchBar resignFirstResponder];
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>-(BOOL) searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
  
      if([text isEqualToString:@"\n"])
      {
          [searchBar resignFirstResponder];
          return NO;
      }
      return YES;
  
  }
  </code></pre>
  
  <p>3.</p>
  
  <pre><code>- (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar
  {
       [searchBar resignFirstResponder];
  }
  </code></pre>