- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SecondViewController *second=[[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
second.getString=[getArray objectAtIndex:indexPath.row];
[self performSegueWithIdentifier:@"Action" sender:nil]; }
如何從一個視圖數據傳遞到另一個,在我的應用程序有一些對象,我想,當我在任何電池接頭則該值應在其中具有UILabel
下一個視圖控制器顯示?怎麼可能通過didSelectRowAtIndexPath將數據從tableview控制器傳遞到下一個viewController(即不使用Segue)?
如果你想瀏覽下一個'viewController'那麼你必須執行,否則賽格瑞你可以替換賽格瑞'[self.navigationController pushViewController:第二動畫:是] ;'導航並傳遞數據。 – 2014-10-10 05:22:35
關於將數據從一個控制器傳遞到另一個控制器的問題確實應該從SO中被禁止。他們已經被問及已經回答了幾千次了。 – rdelmar 2014-10-10 05:29:53
Segue標識符是否也會聲明? – 2014-10-10 05:32:58