Uitableview 根据选定的表行修改tableview(位于另一个视图控制器上)

Uitableview 根据选定的表行修改tableview(位于另一个视图控制器上),uitableview,didselectrowatindexpath,Uitableview,Didselectrowatindexpath,如何根据选定的行更改位于新视图控制器中的表视图中的图像 e、 假设我在我的类别视图控制器中有一个hv类别表。现在当用户点击相机时,一个新的视图控制器应该加载包含所有相机图像的内容,点击任何图像时,它应该显示其细节 如何实现这一点,因为我是这项技术的新手,请帮助我…您可以按照一些简单的步骤使其工作 1。第一个视图:在tableview的didSelectRowAtIndexPath方法中添加以下代码 -(void)tableView:(UITableView *)tableViewdidSelec

如何根据选定的行更改位于新视图控制器中的表视图中的图像

e、 假设我在我的类别视图控制器中有一个hv类别表。现在当用户点击相机时,一个新的视图控制器应该加载包含所有相机图像的内容,点击任何图像时,它应该显示其细节


如何实现这一点,因为我是这项技术的新手,请帮助我…

您可以按照一些简单的步骤使其工作

1。第一个视图:在tableview的didSelectRowAtIndexPath方法中添加以下代码

-(void)tableView:(UITableView *)tableViewdidSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
    //Fetch the value of the selected row in NSString

    NSString *tableRowValue = cell.textLable.text;


    //Call the next view

    secondView *secondViewController = [[secondVIew alloc] initWithNibName:@"secondView" bundle:nil];

    secondViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve ;

    //Initialize the view with the clicked row value thwough NSString variable 
    [secondViewController initializeWith:tableRowValue];

  }
2.第二视图:

在.h文件中,添加以下初始化方法:

-(void)initializeWith:(NSString *)sentRowValue;
-(void)initializeWith:(NSString*)sentRowValue
  {
      NSString *receivedRowValue = sentRowValue;
      //take log to check 
  }


// now perform all the table view delegate methods using the value you have received.
在.m文件中,实现初始化方法:

-(void)initializeWith:(NSString *)sentRowValue;
-(void)initializeWith:(NSString*)sentRowValue
  {
      NSString *receivedRowValue = sentRowValue;
      //take log to check 
  }


// now perform all the table view delegate methods using the value you have received.
注意:声明.h文件中的所有变量,将它们作为属性,并在.m文件中合成它们


希望这有助于

下次,添加一些代码以供参考,并使您的问题更具体、更清晰。此外,你应该张贴你所做的努力