Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个有 3 个故事板场景的应用程序。在第一个故事板场景中,我有一些我想在其他两个场景中访问的变量。我该怎么做?我使用 Storyboard segue 导航到其他两个场景并在按钮单击时调用以下内容
[self performSegueWithIdentifier:@"nameofsegue" sender:self];
使用此方法
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"nameofsegue"]) { YourDestinationVC *dvc = [segue destinationViewController]; YourSourceVC *svc = (YourSourceVC*)sender; //set your ivr here } }