IOS UITableView单元点击事件

//选择表视图行时触发
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([segue.identifier isEqualToString:@"ShowSelectedCity"])
    {
        DetailViewController *detailViewController = segue.destinationViewController;
        NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row];
        
        NSDictionary *dict = [self.listData objectAtIndex:selectedIndex];
        
        detailViewController.url = [dict objectForKey:@"url"];
        
        NSString *name = [dict objectForKey:@"name"];
        
        detailViewController.title = name;
    }
}

你可能感兴趣的:(IOS)