0

Once I launch my application, the BaseVC inits. In BaseVC, I will verify whether user has logged in. If true, my app will jump to main tabbar controller by using:

UIApplication.sharedApplication().windows.last?.rootViewController = tabbarController

If not, my app will jump to login nav controller by using:

UIApplication.sharedApplication().windows.last?.rootViewController = navi

The code above runs correctly as I wanted. But in the Login Nav Controller, after the user inputted the correct username and password, I want the app to jump to the main tabbar controller by using the same code as above:

UIApplication.sharedApplication().windows.last?.rootViewController = mainController

But always, I will get crush with error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[Myapp.MyappMainTabbarVC inhibitRotationAnimation]: 
unrecognized selector sent to instance 0x7ff15b205ec0'

Why?

Desmond
  • 767
  • 1
  • 6
  • 18
  • Are you sure you're passing the same object the first and the second time around? First you're passing `tabbarController`, then you're passing `mainController` to the window's `rootViewController` property. – Bell App Lab Dec 19 '15 at 14:52
  • @BellAppLab Sorry for the misleading of names. I'm sure that the two names are the same object. – Desmond Dec 19 '15 at 15:05

0 Answers0