Friday 20 November 2015

How to pass index another UIController ios/iphone


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{

 if ([[segue identifier] isEqualToString:@"showDetail"]) {
 NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
 NSString *selectedNation =[[[self.tableView cellForRowAtIndexPath:

indexPath] textLabel] text];
[[segue destinationViewController] setSelectedNation:selectedNation];
 [[segue destinationViewController] setDelegate:self];
    }