My target is to populate an Tableview. For that m using Sqlite database as I need to add, delete and update that table using array. Using Sqlite, I can easily achieve this target. But,once we restart our app all the data stored in that array would be lost. But, the data that the table has, should be available in all the devices in which this app has be installed. To achieve this target I think of using Plist. Is there any other way to achieve this target?
Share
Your question isn’t worded very clearly but from what I understand, you have some static data you’ve inserted into a sqlite database. If you want this data to be available, you should take the sqlite database containing that data and keep it in your app’s
Resourcesfolder so that it actually gets copied to the app. You can then acquire a path to the database file usingNSBundlemethods and go from there.If it’s not a lot of data, you can just create a static array or something and store it there. You might also consider looking into Core Data instead of working with raw sqlite.
You could also store the data in a property list or some other file and read it out of there. Don’t use
NSUserDefaultsfor this though; that property list is more appropriate for user preferences, not static data.