-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"searchCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
searchField = (UITextField *)[cell viewWithTag:10000];
[searchField resignFirstResponder];
}
Okay, I have a cell with a identifier name of "searchCell". This cell contains one single UITextField with tag 10000 that pops up a keyboard on the bottom of the screen. When a user touches another cell, the keyboard must be hidden so that the user can have larger space to scroll up and down.
However, when a keyboard has popped up and a user touches(select) a cell, the code above is called but not working... :( It seems like the assigned UITableViewCell is not the one that the user is currently using. What am I doing wrong here?