Attempted to perform a fetch but could not find any persistent store for the entity #267

Closed
opened 2025-12-29 15:27:54 +01:00 by adam · 1 comment
Owner

Originally created by @Pratik-Sodha on GitHub (Apr 12, 2019).

I am using Version 6.3.1. With swift 5 and xcode 10.2.

Using below code to fetch all records.

extension Post {
    static var allPosts: [Post] {
        var posts :  [Post] = []
        do {
            posts = try CoreStore.fetchAll(From<Post>().tweak({ $0.includesPendingChanges = false }))
        } catch {
            print(error)
        }
        return posts
    }
}

Getting below error message.

⚠️ [CoreStore: Error] From.swift:155 applyToFetchRequest(_:context:applyAffectedStores:)
↪︎ Attempted to perform a fetch but could not find any persistent store for the entity
(CoreStore.CoreStoreError) .persistentStoreNotFound (
.errorDomain = "com.corestore.error";
.errorCode = 8;
.entity = Post;
)

Originally created by @Pratik-Sodha on GitHub (Apr 12, 2019). I am using Version 6.3.1. With swift 5 and xcode 10.2. Using below code to fetch all records. ``` extension Post { static var allPosts: [Post] { var posts : [Post] = [] do { posts = try CoreStore.fetchAll(From<Post>().tweak({ $0.includesPendingChanges = false })) } catch { print(error) } return posts } } ``` Getting below error message. > ⚠️ [CoreStore: Error] From.swift:155 applyToFetchRequest(_:context:applyAffectedStores:) > ↪︎ Attempted to perform a fetch but could not find any persistent store for the entity <Post> > (CoreStore.CoreStoreError) .persistentStoreNotFound ( > .errorDomain = "com.corestore.error"; > .errorCode = 8; > .entity = Post; > )
adam closed this issue 2025-12-29 15:27:54 +01:00
Author
Owner

@Pratik-Sodha commented on GitHub (Apr 12, 2019):

Solve using retrieve data into main.async{ } queue.

DispatchQueue.main.async { let posts = Post.allPosts }

@Pratik-Sodha commented on GitHub (Apr 12, 2019): Solve using retrieve data into main.async{ } queue. ` DispatchQueue.main.async { let posts = Post.allPosts }`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#267