Keeping the sqlite 3 database open using swift 3

31 Views Asked by At

I am able to create tables and load several of them with data but when I go to access the data again to retrieve data the program is telling the table does not exist. I am creating the tables from within the viewcontroller. I read in one of these posts that it should not be done from within viewcontroller but from another class. My question is who should this be done. I would also like to be able to insert and retrieve data from a second viewcontroller. How is this accomplished? What type of class needs to be set up to keep the database open throughout the entire program? I have searched the internet for answers but have not found what I am looking. An example and some explanations would be most helpful. If more information is needed I can provide. Thank you in advance

0

There are 0 best solutions below