Extra info:
I have a messaging view in which I have a UITextView
of which I save the text in the conversation's variable draft
in the viewWillDisappear
.
When the app tries to refresh the user's access code, they might get a "could not refresh" response, and the app logs the user out (only one device may be logged in at one time in this app).
In the logout method, I remove all app settings and empty out Core Data, then I set a new rootViewController
and perform makeKeyAndVisible
.
Question:
Now that you know all this, setting the rootViewController
calls viewWillDisappear
, which in turn tries to set the draft
variable on a conversation that no longer exists in Core Data...
What can I do to solve this?