Trying to overwrite sqlite database in iPhone app update
Unlike most sqlite apps where developers don’t want to overwrite data in a sqlite database, I’m trying to enable an app to overwrite all data with future updates. The sqlite database will have the exact same name and have the same tables, I just want to be able to update the data contained in the database without making users delete the app and reinstall it. Is there an easy method to do this?
Thanks in advance!
- Edit PDF in iphone application
- Allow only specific translations for different schemes/targets
- iOS - Check for push notification support in the app
- AFNetworking not resuming download
- UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath
- How to programmatically add a UITabBarController & UINavigationController in AppDelegate?
2 Solutions Collect From Internet About “Trying to overwrite sqlite database in iPhone app update”
A SQLite database file is just a normal file, so no special steps are needed. Get the path or URL to the file, and use NSFileManager’s
-removeItemAtURL:error:. Then create the new database the same way you created the old one.
- iOS – Creating multi page PDF from HTML content
- Convert decimal coordinate into degrees, minutes, seconds, direction
- Speech recognition framework for iOS that supports Spanish
- Keeping directory structure when creating frameworks in xcode
- didSelectViewController does not get called on certain occasions
- How to share an gif animated images in iOS
- Weird issue during migration from Swift 2 to Swift 3: Initializer has different argument names from those required by protocol
- What's difference between NSPhotoLibraryAddUsageDescription and NSPhotoLibraryUsageDescription?
- Swift 3: How to create blurred side edges/corners of a UIImageView?
- How to fully remove Xcode 4
- How to implement search in a table view (with FRC)
- Preloading a database in iOS 7
- HTML Content fit in UIWebview without zooming out
- Automatic scrolling scrollview
- Why/when do I have to tap twice to trigger click on iOS