I use this code to resign my UITextField as firstResponder when using a standard UIView.
But I now have UITextField in my UITableViewCell in a UITableView, and the code does not resign the textfield as first responder when I click outside of the textField. Any ideas how to make this work?
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if ([self.temperatureTextField isFirstResponder] && [touch view] != self.temperatureTextField) {
[self.temperatureTextField resignFirstResponder];
}
[super touchesBegan:touches withEvent:event];
}

[[self tableView] endEditing:YES];is my standard approach.