Tuesday, 15 January 2013

ios - Swift give back a value to tableview controller -


I have two table view controller when I click on a cell, I came second. By clicking on a cell in the second table view, I want to return the value of this cell to the first table view controller. So I have this code in another tableview.

  go footage = self.storyboard? .instantiateViewControllerWithIdentifier ( "OverviewFine") FinesOverviewTableViewController view.s_choosenPlayer = a_players [actualIndicator] .PlayerName  as 

I data in the first tableview controller reload

  ViewDidAppear Function Override (Animated: Bull). {Self.tableView.reloadData ()}  

But now, the variable "s_choosenPlayer" in "" value. What's wrong thank you in advanced.

With the usual delegation to it. When you segue from another controller for the first time, you apply prepareForSegue, and there set myself (first controller) as the representative of another controller. The second controller is required to define a representative protocol, and when you click on a cell, a method call on his representative is not an illustration of a new controller when you go back - either discarded or Depending on what pop was next segue


No comments:

Post a Comment