Static Tableview Cells

I have a static cell which contains a subtotal formula. I can enter the quantity and cost to get the subtotal. I would like the cell to update anytime the user changes either the quantity or cost. Can this be done with a tableview reload? if I go out of the view controller and come back it will refresh, but still would like it to automatically update.

Hi @jport1130

Every time user enter and / hit submit button, then you have to reload particular cell which contains formula. So that is update every time and display correct value on the screen.

You have to mention your row index and section index :

    [self.tblNewsFeedList reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade];

I guess :

  • You have one UIViewController
  • In that you have UITextFields and UIButton
  • Also you have UITableView in that you have put formula for final value.

For ex. :

  • User enter 3 in first textfield
  • And 5 in second textfield, then hit submit
  • Tableview which contains formula : (total = textfield1.text * textfild2.text)
  • It will display 15 (3 * 5) in cell on UILabel

This topic was automatically closed after 166 days. New replies are no longer allowed.