0

This is really getting to me guys and if possible i would like if you can help to see where im going wrong. Im new to iOS development and getting through it all but this problem has limited me in what Id like to do with my application.

My storyboard consists of the following layout:

-> Tabbed bar controller with 3 "tabs" (Exercise Descriptions, Login, Message Board)

The Exercise descriptions and Message board have imbedded Navigation controllers with Table Views that extract data and are working perfectly fine. The login board is my problem. Clicking the login tab produces my login screen with email and password fields that are linked to a json request from a php file, all is working fine. Now once they have logged in they have the option to "Make A Booking" and to "Record a new one rep max for a exercise". Id like the login screen to include a navigation controller that then allows them to go from bookings back to the "Successful" login page and then also back to the previous "login page" with their details. Im not storing tokens to keep them logged into their account and as soon as they go back they would have to relogin.

The error i get when the user selects the button from the logged in page to go to "Make A Booking" is as follows

2014-09-06 14:21:23.980 CrossfitPotch[94366:60b] * Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'

I can understand the error but dont know how I would fix this. Any assistance is really appreciated .

Soprono
  • 215
  • 3
  • 14
  • What i have done for now is link a new tab bar controller to the page after the successful login with then my 3 items on their. The info page then has a button to go back to the main screen. Seems to be working fine. – Soprono Sep 06 '14 at 13:48

1 Answers1

0

Sounds like you need to embed your controller in a navigation controller. In Xcode, select your controller, click on the Editor menu, then choose, "Embed In..." and choose "Navigation Controller".

Gismay
  • 784
  • 9
  • 17
  • If I embed the page after the login has taken place successfully I am unable to press "Back" to the login page before it. – Soprono Sep 06 '14 at 15:07
  • I see what you mean. I have had a similar layout, and I used an Unwind Segue to go back to the previous view. Have you tried that? – Gismay Sep 06 '14 at 16:37
  • Following on from my comment above, this may be helpful;http://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-do-you-use-them/15839298#15839298 – Gismay Sep 06 '14 at 16:46
  • Just did this now and finally success! Thanks man was about to change the whole layout of everything to get this right but managed to do so now. Thanks @Gismay. Resolved – Soprono Sep 07 '14 at 15:18