Do i need to Enable WAL mode to copy .SQLite from bundle to Document directory?
My current application only copying .sqlite file
(WAL MODE = DELETE).
Everything went smoothly , the new copied myfile.sqlite also contain data perfectly.
When I execute a fetch request , the execution has no error , and BOOL (success) is 1 . BUT the returned array always EMPTY.
This tutorial told me I neeed to copy 3 files (
.sqlite , .sqlite-wal , .sqlite-shm) in to Document directory .
Does this mean I need to Enable WAL mode and re-do everything from the start? In Xcode 10 we still cannot copy just 1 .sqlite file? Can someone clarify this?
- Magical Record - fetch in main thread block ui, in background return nil
- core data ios9: multifield unique constraint
- Core Data not saving transformable NSMutableDictionary
- Core Data could not fullfil fault for object after obtainPermanantIDs
- Generating Swift models from Core Data entities
- Storing images to CoreData - Swift
Solutions Collect From Internet About “Do i need to Enable WAL mode to copy .SQLite from bundle to Document directory?”
Assuming that you mean journal mode, and not
WAL MODE (and that you mean Xcode 8.x, since Xcode 10 doesn’t exist yet), no you do not need to copy any additional files or change modes. With journal mode set to
DELETE there’s only the one file. You don’t need to create extra files to make copying work.
But there are several other problems you might be having, which you should check on, and if necessary post additional questions about:
- Maybe the copy phase isn’t actually working as perfectly as you think.
- Maybe you’re not adding the SQLite file to the persistent store coordinator– so it’s not available when you do the fetch.
- Maybe your fetch is misconfigured and is trying to fetch data that isn’t present.
As for your question though, no you do not need to copy other files, or change the journal mode to force those other files to exist.
- Basics Introduction To Using CHCSVParser
- NSUserDefault with App Group is not working in iOS 8 Beta3
- Techniques for offline reverse geocoding on a mobile device?
- Delete a UITableView row by click on custom UIButton
- Change child view controller
- Fatal error: use of unimplemented initializer in custom navigationcontroller
- Static analyser issues with command line tools
- Ambiguous reference to member when using ceil or round
- How to make marquee UILabel / UITextField / NSTextField
- Get most recent data point from HKSampleQuery
- Keep losing php session cookie in UIWebView
- Cocoa: Checks required for multiple asynchronous NSURLConnections using same delegate functions?
- Can't pass Date to NSPredicate(format: …) without “as CVarArg”
- NSArray of int
- What are “Imported UTIs” in Xcode 4?