我在第二个viewController中使用Segue从一个ViewController转到另一个ViewController有一个UITableView。现在,我想从第二个ViewController的didSelected方法推送到另一个viewController。
代码用于Segue:
-(void) searchButtonClicked:(id)sender {
[self performSegueWithIdentifier:@"search" sender:nil];
}
按钮操作下的:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
PackageListVC *pdvc = (PackageListVC *)[self.storyboard instantiateViewControllerWithIdentifier:@"PackageListVC"];
pdvc.strServiceProviderId = [[[arrSearch objectAtIndex:indexPath.row] objectForKey:@"ServiceProviderId"] stringValue];
pdvc.strCategoryId = [[[arrSearch objectAtIndex:indexPath.row] objectForKey:@"CategoryId"] stringValue];
pdvc.strSubCategoryId = [[[arrSearch objectAtIndex:indexPath.row] objectForKey:@"SubCategoryId"] stringValue];
pdvc.strTitle = [[arrSearch objectAtIndex:indexPath.row] objectForKey:@"CompanyName"];
[self.navigationController pushViewController:pdvc animated:YES];
}
此处出现的主要问题是,无法使用以下代码进行导航:
@RequestMapping(value = "/uploadFile/{fileType}", method = RequestMethod.POST)
public void fileUpload(@RequestParam MultipartFile file, @PathVariable String fileType) {
// ...
}
答案 0 :(得分:0)
您可以使用prepareForSegue
方法执行此操作。
你声明svc(SearchVC *svc = segue.destinationViewController;
),你可以这样说:
svc.variable = 1;