Overview
I have an iOS project in which I store a list of names in a table view.
I understand the moment the database is opened / created, there is a completion handler to execute a method.
Steps:
- In my case, the first screen is a table view which displays the names
- there is a + button (on the navigation bar) to add a new name which would take it to a new screen to enter the details.
Concern
My worry is that if I fetch the names for the tableview in the completion handler and if the user doesn't wait for the database to be opened and creates a new name, while saving it, the database might not be opened / created.
Questions
- How to handle such a situation ?
- Am I missing something ?