Jannes
Jannes

Reputation: 19

Xcode problems with presenting ViewController

I have a very annoying problem. I have two View Controllers. I just call them ViewController and SecondViewController. They are NOT linked in an UINavigationController. When I present the SecondViewController I don't get any error. Now I go back to ViewController. When I call the SecondViewController now, I get two errors:

Presenting view controllers on detached view controllers is discouraged <ViewController: 0xadd5220>.

and

*** -[SecondViewController isKindOfClass:]: message sent to deallocated instance 0x16bc1e30

I use custom segues, but it's the same when I use modal segues

Can you help me?

Regards Jannes

Upvotes: 0

Views: 145

Answers (1)

Marcelo Ribeiro
Marcelo Ribeiro

Reputation: 1738

Looks like your SecondViewController instance is gone by the time you go back to your ViewController. Make sure you're instantiating it again before calling it to appear.

Upvotes: 1

Related Questions