如何从一个控制器将值传递给另一??? 我用故事板。
我想这出现在第一个视图中突出显示的文本视图。
调用的代码的下一个观点,我觉得这样的事情应该是这样的:
UIStoryboard *finish = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *viewController = [finish instantiateViewControllerWithIdentifier:@"FinishController"];
viewController.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentModalViewController:viewController animated:YES];
finishcontroller:
- (void)viewDidLoad
{
self.lblFinishTitle.text=self.FinishTitle;
self.lblFinishDesc.text = self.FinishDesc;
self.lblFinishPoint.text=self.FinishPoint;
[super viewDidLoad];
// Do any additional setup after loading the view.
}
第一种观点:
-(void) prepareForSegue:(UIStoryboardPopoverSegue *)segue sender:(id)sender
{
if ([segue.identifier hasPrefix:@"FinishController"]) {
FinishController *asker = (FinishController *) segue.destinationViewController;
asker.FinishDesc = @"What do you want your label to say?";
asker.FinishTitle = @"Label text";
asker.FinishPoint = @"asdas";
}
}
我想通过造成代码的传输值