gpt4 book ai didi

ios - ios 5 中带有 Storyboard 的 Table ViewController

转载 作者:行者123 更新时间:2023-12-01 16:59:55 24 4
gpt4 key购买 nike

我已经开始使用 Storyboard,这是 iOS 5 中的一个新功能,所以我从一个选项卡式应用程序开始,然后我添加了一个表格 View Controller 并用一些虚拟数据填充单元格,现在,表格有 4 个单元格,现在点击每个单元格,我想打开一个新的ViewController,每个单元格都不同,

所以以前,我曾经这样编码

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];

if(indexPath.row == 0)
{
FirstViewController *settingsView =[[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
[self.navigationController pushViewController:settingsView animated:YES];
}
if(indexPath.row == 1)
{
SecondViewController *settingsView =[[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:settingsView animated:YES];
}
if(indexPath.row == 2)
{
ThirdViewController *settingsView =[[ThirdViewController alloc]initWithNibName:@"ThirdViewController" bundle:nil];
[self.navigationController pushViewController:settingsView animated:YES];
}

}

但是知道,我该怎么做..请帮帮我

感谢和问候
兰 git

最佳答案

关于ios - ios 5 中带有 Storyboard 的 Table ViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8077613/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com