sujith1406
sujith1406

Reputation: 2822

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)textFieldShouldEndEditing:(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?

Upvotes: 0

Views: 109

Answers (1)

crackity_jones
crackity_jones

Reputation: 1077

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.

Upvotes: 1

Related Questions