How can I check what is stored in my Core Data Database?

后端 未结 17 2198
北恋
北恋 2020-12-12 14:35

I am making an app that relies on Core Data. I am able to enter data into a text field and store it.

But I need to know if the data is being stored.

I am try

17条回答
  •  半阙折子戏
    2020-12-12 15:01

    In Swift 3, you have the the NSPersistentContainer and you can retrieve the path from there like this:

    persistentContainer.persistentStoreCoordinator.persistentStores.first?.url
    

    (Assuming you are only using one persistent store)

提交回复
热议问题