Now that you've posted code, the problem is obvious. You create a view controller but you never display it (in the something
method). Then you call a method on this undisplayed view controller (mail
) which attempts to display the mail view controller from the undisplayed view controller. This is what causes the error.
You need to display the mail controller from a view controller that is already being displayed (such as the rootViewController
maybe).
What is the point of your ViewController
class?