call a method in uitableivewcontroller from a method in custom uitableviewcell in the uitableivewcontroller
I need to call a method say
-(void)calculateValues
in uitableviewController from a custom- uitableviewcell method such as
-(BOOL)textF开发者_如何学PythonieldShouldEndEditing:(UITextField *)textField
. The purpose is to refresh the values in other tableview cells based on the value entered through a textfield in this uitableivewcell. but how to access the uitableviewcontroller from the cell;self.superview will only point to the uitableview but i need to get the viewcontroller.how to get this?
You could use either a notification if its a few levels separated or a delegate pattern if you know about the view controller at creation time of the cell.
精彩评论