user2250827
user2250827

Reputation: 3

ios 6 - Fire segue just after data has been loaded

I have some data in TableView. What I want is to call services just after user tapped on row. Main problem is that 'performToSegue' is calling first so there is no data to populate in tableView in destination controller.

How can I call segue just after data has been retrieved?

Thanks a lot for suggestions!

Upvotes: 0

Views: 254

Answers (1)

Paul.s
Paul.s

Reputation: 38728

  • You'll need to delete the segue in the storyboard that you dragged from a cell to the next viewController.
  • Next make a segue by dragging from the current controller to the next controller

enter image description here

Now in the UITableViewController implement

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
      // Do some network request
      // on completion call
      [self performSegueWithIdentifier:@"theIdentifierUsedInStoryboard" sender:self];
    }

Upvotes: 1

Related Questions