How to view data stored in Core Data?

前端 未结 11 652
醉酒成梦
醉酒成梦 2020-12-01 01:51

I\'m creating a Core Data model for my application. I would like to be able to look inside it to see what I have stored in there.

Is there an easier way tha

相关标签:
11条回答
  • 2020-12-01 02:34

    3 Easy Steps

    1. install liya application, its free, Size 3.1 MB, so installs in 1 minute.
      Link https://itunes.apple.com/us/app/liya/id455484422?mt=12.

    2. Open Finder, Press "Ctrl + G" OR "CMD + Ctrl + G", Paste ~/Library/Developer/
      In Developer Folder, search for your Core Data model name (eg. MyProjectModel).

    3. Open MyProjectModel.d file Or 'MyProjectModel.sqlite' using liya. In liya, select a table, Click on "Run SQL Command".

    Done.

    0 讨论(0)
  • 2020-12-01 02:41

    You can also use FireFox's Add-on tool SQLite Manager (FREE). I use it and it works well.

    0 讨论(0)
  • 2020-12-01 02:41

    If you are using iOS 10 & Swift get it into your AppDelegate.swift:

      let container = NSPersistentContainer(name: "***")
      print(container.persistentStoreDescriptions.first?.url)
    

    Then you'll see something like that:

    Optional(file:///Users/<SomeUser>/Library/Developer/CoreSimulator/Devices/956F0003-5DA4-4588-97C1-A9A83767F341/data/Containers/Data/Application/9765FDE1-6971-4706-987B-96FBD3F462BF/Library/Application%20Support/***.sqlite)
    
    0 讨论(0)
  • 2020-12-01 02:43

    You can try a little free tool called CoreDataPro. Pretty nice. Here

    0 讨论(0)
  • 2020-12-01 02:43

    Also try sqlite database browser. its free and reflects that fact. very useful though!

    cheers.bo

    0 讨论(0)
提交回复
热议问题