开发者

i want to show textfield data in tableviewcell which replace the existance data on cell in iphone?

In my application i hve tableview开发者_如何学JAVAcontroller and its detailviewcontroller(dvc). dvc contains textfield and button.I actually want when i clicked on button textfield text is replaced the tableview cell text.what can i do ? explain in detail


  1. Define a delegate protocol, that contains the method - (void)textHasChangedTo:(NSString*)text
  2. Make tableviewcontroller conforming to this protocol.
  3. Implement - (void)textHasChangedTo:(NSString*)text on tableviewcontroller, so that it changes the text in the cell. For Example change the text in your model and let the tableView reloadData.
  4. Define a delegate property on dvc.
  5. Set the delegate of dvc to tableviewcontroller before pushing the dvc onto the navigation stack.
  6. In the button action, call textHasChangedTo: on the delegate with the new text.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜