【发布时间】:2014-03-01 06:01:25
【问题描述】:
我使用了两个tableviewcontrollers,我想在其中显示国家名称数组数据
第一个 tableviewcontroller (recipeBookTableViewController) 和第二个 tableviewcontroller (RecipetableviewController) 中的其他大写数组数据,
当单击第一个 tableviewcontroller 单元格时,它应该移动到第二个 tableviewcontroller 并带有大写数组数据。
我已采取prepareforSegue 方法转移到第二个tableview。但该方法从未被调用。
如何将数据发送到下一个tableview。
RecipeBookViewController(table1) Recipetableview(table2)
INDIA (cell) ------------> Delhi(cell)
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"showRecipeDetail"])
{
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
RecipeDetailViewController *destViewController = segue.destinationViewController;
destViewController.second = [onew objectAtIndex:indexPath.row];
NSLog(@"%@",onew);
NSLog(@"data is %@",destViewController.second);
// destViewController.lable2 = [derivationArray objectAtIndex:indexPath.row];
// destViewController.image = [iconArray objectAtIndex:indexPath.row];
}
}
【问题讨论】:
标签: ios iphone objective-c storyboard