Search code examples
iosios6uitableviewafnetworkingsegue

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!


Solution

    • 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];
        }