使用Segues将数据(字符串)从子视图控制器传递到父VC

时间:2012-12-11 21:19:10

标签: objective-c ios

使用Segues将子视图控制器中的数据(字符串)传递给父VC。 有人可以向我推荐最快最简单的方法(在故事板中),

2 个答案:

答案 0 :(得分:0)

尝试这个博客,它解释了你需要知道的每一件事:)

http://www.appcoda.com/storyboards-ios-tutorial-pass-data-between-view-controller-with-segue/

UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
ActionsViewController *vc =[storybord instantiateViewControllerWithIdentifier:@"-----"];
vc.Title =[namesarray objectAtIndex:indexPath.row];//where Title variable at next view class
[self.navigationController pushViewController:vc animated:YES];

答案 1 :(得分:0)

你需要实施 prepareForSegue:sender: 您可以访问destinationViewController

相关问题