CoreStore Xcode data fault issue when fetching objects

I'm new to CoreStore and attempting to test my ability to create, store, and fetch CoreStore Objects correctly. It appears entries are being created based on results of dataStack.fetchCount() and transaction.create(), but the data is unavailable or not stored correctly based on my results of dataStack.fetchAll() (it says data: fault at the end of each object) and inspection of the SQLite database with Liya software reveals no entries in the table. I'm using CoreStore v8.0.1 and Xcode v12.4. My example code (using synchronous execution) is below. I appreciate your input into troubleshooting the issue. Thanks.


import CoreStore
final class MyImage: CoreStoreObject {
    var desc: String = ""


import SwiftUI
import CoreStore
import Foundation

struct MyApp: App {
    static let dataStack: DataStack = {
        let dataStack = DataStack(
                modelVersion: "V1",
                entities: [
                versionLock: [
                    "MyImage": [..., ..., ..., ...]
        try! dataStack.addStorageAndWait(
            SQLiteStore( fileName: "MyStore.sqlite",
                //localStorageOptions: .allowSynchronousLightweightMigration,
                localStorageOptions: .recreateStoreOnModelMismatch
        return dataStack
    init() {
        CoreStoreDefaults.dataStack = MyApp.dataStack
        try! dataStack.perform(
            synchronous: { (transaction) in
                let test_obj = transaction.create(Into<MyImage>())
                test_obj.desc = "Description"
            waitForAllObservers: true
        do {
            let objects = try dataStack.fetchAll(From<MyImage>())
        } catch { print("error fetching")}
    var body: some Scene {
        WindowGroup {

I appreciate your help.

Read more here:

Content Attribution

This content was originally published by euro_passion_2005 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: