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.

  • UISearchController not dismissed when View is pushed
  • Image Sharing Using Google Plus in ios
  • Load many gif to UICollectionView
  • Unwanted Vertical Padding from iOS 6 on CATextLayer
  • Disable horizontal scroll in UIScrollView with autolayout
  • How to set root view controller
  • Core Data Basics: Preload Data and Use Existing SQLite Database

    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?

    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.