So heres my question. I am a silent stackoverflow skimmer and Im using xcode 4.5 storyboards for an application which starts with a view controller which asks for the username and password. My application checks data via a backend server and then if the login is correct it performs a segue which points to the uinavigationcontroller which forwards the screen to the main menu.... The uinavigationcontroller hasnt been tampered with and pushes the mainmenu automatically.
Login_screen -> UINavigationController -> Main_Menu
My question is how do i pass the NSString
username from the login screen to the main menu screen.
I understand how to pass data from one screen to the next when the segue is pointing directly to it via the prepareforsegue
method as well as performsegue
. But in this case the login_screen
segue points to the uinaviationcontroller
which points to the main_menu controller
My assumption is that i will need to make a custom class which inherits UINavigationController
and implement certain methods but since uinavigationcontroller
isnt seen i dont think viewdidload
or viewwillappear
are the right methods.
Any help will be appreciated
I am a new user so i am not allowed to post images but i will fix that as soon as possible
You can use the topViewController property of the UINavigationController.
Cast the UINavigationController.topViewController object to Main_MenuViewController and set the data normally.
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With