Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in executeInResponseToFetchRequest #30

Open
pronebird opened this issue Dec 23, 2015 · 4 comments
Open

Crash in executeInResponseToFetchRequest #30

pronebird opened this issue Dec 23, 2015 · 4 comments

Comments

@pronebird
Copy link

I see crash in executeInResponseToFetchRequest where it expects NSManagedObject but it gets NSManagedObjectID instead...

I am bridging MagicalRecord with Seam so I assume this may be the cause of me doing something wrong... or maybe not.

This is my current implementation which is simply uses Seam store, everything else is left intact:

https://gist.github.com/pronebird/1a6db53e6f75e7baf109

Log:

Not coming
Sync Performed
Sync Performed Successfully
Could not cast value of type '_NSCoreDataTaggedObjectID' (0x10784df60) to 'NSManagedObject' (0x10784e9b0).

Therefore in this context we get crash:

    // MARK : Fetch Request
    func executeInResponseToFetchRequest(fetchRequest:NSFetchRequest,context:NSManagedObjectContext) throws ->NSArray {
        let resultsFromLocalStore = try self.backingMOC.executeFetchRequest(fetchRequest)
        if resultsFromLocalStore.count > 0 {
            return resultsFromLocalStore.map({(result)->NSManagedObject in
                let result = result as! NSManagedObject <-- CRASH
@Dysonapps
Copy link

Did you figure out a solution?

@pronebird
Copy link
Author

@Dysonapps I switched to Ensembles.

@Dysonapps
Copy link

Thanks, what's you're experience been like with Ensembles?

@pronebird
Copy link
Author

@Dysonapps only positive. If you need to plug-in cloud synchronization like today, then I don't know any better alternative to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants