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 because of NSMutableOrderedSet #31

Open
dehlen opened this issue Dec 28, 2015 · 2 comments
Open

Crash because of NSMutableOrderedSet #31

dehlen opened this issue Dec 28, 2015 · 2 comments

Comments

@dehlen
Copy link

dehlen commented Dec 28, 2015

Hello,

When using this library I get the following error message:
Could not cast value of type '_NSFaultingMutableOrderedSet' (0x19fe9c2e8) to 'NSSet' (0x19fe879e8).
It occurs in SMStore.swift - setRelationshipValuesForBackingObject: because of this line:

let relationshipValue: Set<NSObject> = sourceObject.valueForKey(relationship.name) as! Set<NSObject>

I can't find my mistake since I already got the inverse relations set up as you are describing in the README. I hope you can give me a hint why this does not work.

Here is my xcdatamodeld setup :
bildschirmfoto 2015-12-28 um 18 32 51
bildschirmfoto 2015-12-28 um 18 32 29
bildschirmfoto 2015-12-28 um 18 32 40
bildschirmfoto 2015-12-28 um 18 32 15

@chbeer
Copy link

chbeer commented Dec 28, 2015

The error indicates that the OrderedSet can not be casted to a regular Set.

Depending on how relationshipValue is used you either can use an iterative protocol that both Set and OrderedSet implement. Or you need to have different ways to use relationshipValue

@chbeer
Copy link

chbeer commented Dec 28, 2015

By "you" I mean Seams SMStore.swift that you could fix.

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