我嘗試此代碼,但它對我無效。 謝謝如何在iOS中的不同視圖控制器之間傳遞變量
-(void)passvar:(NSString *)user
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *viewController = (UIViewController *)[storyboard instantiateViewControllerWithIdentifier:@"signupvc"];
viewController.user = user;
[self presentViewController:viewController animated:YES completion:nil];
}
什麼不正確? – Larme