Iphone 如何从uitableviewcell选择设置子视图的标题
我有一个导航应用程序,其中有一个部分可以定义搜索参数,基本上是一个自定义单元格的uitableview,可以执行不同的操作(uitextview、开关和标签) 我想做的是,当用户从tableview中选择一个单元格时,它将打开一个新的uitableview,当该视图打开时,它将通过php向我的数据库发送一个请求,并获得一个xml响应,该响应将填充该视图的表。但是,我只想在上一个视图中为几个不同的单元格选择使用一个uitableview。我想知道在选择a ParentView单元格时,是否能够指定子视图的标题 我希望这能解释我想要达到的目标。。。如果这不是做事的方式,你能告诉我吗。。但从我一直在做的事情来看,我认为这是做事情的正确方式 **更新 我现在正试图找出如何根据按下的单元格定义标题,我正在尝试这样做Iphone 如何从uitableviewcell选择设置子视图的标题,iphone,ios,uitableview,Iphone,Ios,Uitableview,我有一个导航应用程序,其中有一个部分可以定义搜索参数,基本上是一个自定义单元格的uitableview,可以执行不同的操作(uitextview、开关和标签) 我想做的是,当用户从tableview中选择一个单元格时,它将打开一个新的uitableview,当该视图打开时,它将通过php向我的数据库发送一个请求,并获得一个xml响应,该响应将填充该视图的表。但是,我只想在上一个视图中为几个不同的单元格选择使用一个uitableview。我想知道在选择a ParentView单元格时,是否能够指定
- (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];
}
-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(nsindepath*)indepath
{
//导航逻辑可能位于此处。创建并推送另一个视图控制器。
SearchResponseTableViewController*SearchResponseTableViewController=[[SearchResponseTableViewController alloc]initWithNibName:@“SearchResponseTableViewController”捆绑包:nil];
// ...
//将选定对象传递给新的视图控制器。
[self.navigationController pushViewController:searchResponseTableViewController动画:是];
if(indepath=1,3){/Simple:在didselectrowatinexpath:
中推送视图之前,请指定标题,它是视图控制器的属性
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//...
SubViewController *controller = [[SubViewController alloc] init];
controller.title = @"Whatever";
[self.navigationController pushViewController:controller animated:YES];
}
我会使用if(section=0)、if(indexPath.row==2)等为不同的单元格指定不同的controller.title吗?我如何根据新视图使用indexPath定义不同的标题?对,这就是为什么我要放置/…
。您需要检查indexPath
,并分配适当的标题。