导航并将字符串传递给嵌入在 TabVC 和 NavigationVC 中的另一个 VC
Navigate and pass the string to another VC embedded in a TabVC and NavigationVC
我有以下故事板。
我希望将字符串 sURL 传递给 类 VC。 类 VC 嵌入在选项卡视图控制器和导航控制器中。非常感谢您的帮助。
存储你想要传递给 NSDefaults 的任何字符串,然后在另一个 VC 再次调用 NSDefaults。
//=== Strore into session and send over to Classes VC
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:sURLToClass forKey:@"txtURLFromSearch"];
[defaults synchronize];
//=== This is to call Classes VC
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UITabBarController *tabView = [storyboard instantiateViewControllerWithIdentifier:@"profileView"];
tabView.selectedIndex=0; //=== This is to choose which Tab, starts with 0,1,2,3,4
[self presentViewController:tabView animated:YES completion:nil];
我有以下故事板。
我希望将字符串 sURL 传递给 类 VC。 类 VC 嵌入在选项卡视图控制器和导航控制器中。非常感谢您的帮助。
存储你想要传递给 NSDefaults 的任何字符串,然后在另一个 VC 再次调用 NSDefaults。
//=== Strore into session and send over to Classes VC
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:sURLToClass forKey:@"txtURLFromSearch"];
[defaults synchronize];
//=== This is to call Classes VC
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UITabBarController *tabView = [storyboard instantiateViewControllerWithIdentifier:@"profileView"];
tabView.selectedIndex=0; //=== This is to choose which Tab, starts with 0,1,2,3,4
[self presentViewController:tabView animated:YES completion:nil];