`
iaiai
  • 浏览: 2229377 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

[iphone] 在UITableViewController点击跳转界面

 
阅读更多
在storyboard里新建一个界面....
设置identifier属性:


然后在UITableViewController的didSelectRowAtIndexPath方法里添加如下代码:(先不考虑内存问题)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    TableInfoController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"tableInfoController"];
    detail.title = @"详细信息";
    //detail.state = [datasource objectAtIndex:indexPath.row];
    //detail.capital = [states objectForKey:detail.state];
    [self.navigationController pushViewController:detail animated:YES];
}


这样就可以在UITableViewController中点击一项的时候跳转到下一个界面
  • 大小: 30.9 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics