开发者

call a method in uitableivewcontroller from a method in custom uitableviewcell in the uitableivewcontroller

开发者 https://www.devze.com 2023-03-31 01:48 出处:网络
I need to call a method say -(void)calculateValues in uitableviewController from a custom- uitableviewcell method such as

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消