gpt4 book ai didi

iphone - 如何从 uitableviewcell 选择中设置 subview 的标题

转载 作者:行者123 更新时间:2023-11-29 04:59:47 24 4
gpt4 key购买 nike

我有一个导航应用程序,其中有一个部分可以定义搜索参数,该部分基本上是执行不同操作的自定义单元格的 uitableview(uitextview、开关和标签)

我想要做的是,当用户从 tableview 中选择一个单元格时,它会打开一个新的 uitableview,当该 View 打开时,它将通过 php 向我的数据库发送请求,并获取一个 xml 响应,该响应将填充表那个观点。但是,我只想在上一个 View 中使用一个 uitableview 来选择几个不同的单元格。我想知道当选择父 View 单元格时是否能够指定 subview 的标题。

我希望这能解释我想要实现的目标...如果这不是做事的方式,你可以让我知道..但从我一直在做的事情来看,我认为这是正确的做事方式。

**更新我现在正在尝试弄清楚如何根据按下的单元格来定义标题,我正在尝试做这样的事情..

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.

SearchResponseTableViewController *searchResponseTableViewController = [[SearchResponseTableViewController alloc] initWithNibName:@"SearchResponseTableViewController" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:searchResponseTableViewController animated:YES];
if (indexPath = 1,3) { //<<--- not sure what to do here or if its possible
searchResponseTableViewController.title = @"manufacture";
}
[searchResponseTableViewController release];

}

最佳答案

简单:在 didSelectRowAtIndexPath: 中推送 View 之前,您指定标题,它是 View Controller 的一个属性。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//...
SubViewController *controller = [[SubViewController alloc] init];
controller.title = @"Whatever";
[self.navigationController pushViewController:controller animated:YES];
}

关于iphone - 如何从 uitableviewcell 选择中设置 subview 的标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7237018/

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