开发者

how to display the selected picker date in the detailtext label of previous tableview controller

开发者 https://www.devze.com 2023-04-04 00:09 出处:网络
i have 2 controllers .one controlleris view controller and the other controller is tableview controller.in t开发者_如何学JAVAhe view controller their is a datepicker .when i select a particular time f

i have 2 controllers .one controller is view controller and the other controller is tableview controller.in t开发者_如何学JAVAhe view controller their is a datepicker .when i select a particular time from the date time picker and click on the navigation bar back button the time value must be displayed on my cell.detailtexlabel of my tableview controller.Please help me in solving this problem.Thanks


This would be a good time to use delegates. You would write a custom delegate protocol and have your tableview implement it. When you create your view with the datepicker, set a delegate property on it to point back to the UITableView subclass. Then call one of the delegate methods when the date needs to be stored.

This is a common design pattern for UITableViews, see Apple's documentation.

0

精彩评论

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