开发者

How to populate the table view cell with values entered in another view controller?

开发者 https://www.devze.com 2023-03-06 08:11 出处:网络
I have a custom table view cell, which consists of four labels and an image view. I have another UIViewController which consists of two text fields and one text view.

I have a custom table view cell, which consists of four labels and an image view. I have another UIViewController which consists of two text fields and one text view.

When the values are entered in the text fields and text view of this controller, 开发者_开发百科and the save button is pressed, the values must be saved on to my custom table view cells' text labels. How is this possible?


Update your data source object with the values and call reloadData function on tableview instance

- (void)reloadData

Call as below

[myTableView  reloadData];

EDITED:

First : you could use the delegate concept of Objective-C,

Second: you could store the text value in user default using NSUserDefault and access that in other view controller,

See the very good blog post on NSUserDefault .

iPhone Programming Tutorial – Saving/Retrieving Data Using NSUserDefaults


Capture the Values entered in the Text Inputs and save them in different NSString variables. Set those values for the Next ViewControllers Input.

For example, declare a NSString in second View Controller Interface and @synthesize that. Before moving from first controller to second controller, set the value for that respective variable.

0

精彩评论

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