UITableViewCell Resign FirstResponder
Hi,
I have a UIViewController class that contains a UITableViewCell subclass.
Within the tableViewCell I have a UITextView that calls the numberPad which I have ammended to contain the missing DONE button.
THe DONE button, when pressed calls a method named backgroundPressed. This method is called from the root UIViewController class.
-(IBAction)backgroundPressed:(id)sender{
[textField2 resignFirstResponder];
The problem I have is that calling this method does not dismiss the numberPad. This is probably because the method is called from the开发者_如何学Go UIViewContoller class. How do I access the UITableViewCell to resign the first responder when the for the UITextView?
Many Thanks
This should work. Does textField2 have a valid reference to the textField? I presume that your UITableViewCell is a custom object are you saving a reference to either the cell object or the textfield?
[myCellObject.textField2 resignFirstResponder]
// or
[self.textField2 resignFirstResponder] // should work if you have a valid reference
精彩评论