UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

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.