WWDC24 SALE: Save 50% on all my Swift books and bundles! >>

SOLVED: Can you view what is stored in Core Data?

Forums > SwiftUI

I am working on an app that leverages Core Data. I'm getting some strange results ( I'm sure my fault), but I'm trying to determine if I'm storing data incorrectly, or retreiving data incorrectly. Is there some sort of viewer so I can see what is actually being stored in Core Data?

2      

In almost every case, Core Data stores data in an sqlite database. You can use a database viewer that supports sqlite to peek into the files. See this article for more info: Core Data and Database Browser for SQLite

If you are going to be doing a lot of looking under the hood and don't mind dropping some cash, there's Betamagic's Core Data Lab, which is quite good and is specifically designed to work with Core Data (as you might very well suspect from the name).

2      

Core Data Lab was the exact thing I needed. They even have a free 14 day trial, but I'm shocked to see the app is only $20. Seems like a no brainer purchase.

I opened the app, and within seconds I saw my problem. I had defined an attribute of type UUID, but I never set the UUID so they were all nil.

Screen Shot

Adding id:\.self to my ForEach instantly solved the problem.

Thank you!

2      

Save 50% in my WWDC sale.

SAVE 50% To celebrate WWDC24, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.