How to browse Core Data in my app running on my iPhone?

前端 未结 4 734
深忆病人
深忆病人 2021-01-31 11:44

I\'m working on an iPhone project that uses core data and trying to figure out a way to browse easily how data is being stored. Specifically, I am storing images in core data, a

4条回答
  •  粉色の甜心
    2021-01-31 12:24

    If you don't need to see this information in real time, Xcode's Organizer will allow you to download the sandbox directory of any development apps on the device:

    1. Connect the device to your Mac.
    2. Open Xcode's Organizer window to the Devices tab.
    3. In the source list, select the Applications item under your device.
    4. Pick your application from the list in the main part of the window.
    5. Use the Download button at the bottom of the window to copy the sandbox directory to your Mac.
    6. The data is downloaded in a package, so right-click it in the Finder, and select Show Package Contents.

    From there, any of the many tools available to open/inspect Core Data storage or SQLite databases should work for you.

    You can also use this package when running your app in the simulator or on the device to force the run into a known state. That can be tremendously helpful when debugging things like Core Data migrations or strange invalid states.

提交回复
热议问题