ios - Swift give back a value to tableview controller -


i have 2 tableview controllers. when click on cell come second one. clicking cell in second tableview, want give value of cell first tableview controller. have code in second tableview.

 let view = self.storyboard?.instantiateviewcontrollerwithidentifier("overviewfine") finesoverviewtableviewcontroller  view.s_choosenplayer = a_players[actualindicator].playername 

then reload data in first tableview controller.

 override func viewdidappear(animated: bool) {  self.tableview.reloaddata() } 

but now, variable "s_choosenplayer" has value "". mistake? in advance.

the usual way delegation. when segue first second controller, implement prepareforsegue, , set (the first controller) delegate of second controller there. second controller needs define delegate protocol, , call method on delegate when click cell there. don't instantiate new controller when go -- either dismiss or pop depending on forward segue was.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -