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

Overriding method in category #17

Open
olejnjak opened this issue Feb 24, 2016 · 0 comments
Open

Overriding method in category #17

olejnjak opened this issue Feb 24, 2016 · 0 comments

Comments

@olejnjak
Copy link

Overriding method in category is not a good idea. Right now I came to issue, that I added new version of my Core data model to the project. And since then I can't run the app as Core data throw an exception ('NSInternalInconsistencyException', reason: 'Can't modify an immutable model.').

Reason is that when initializing Core data stack using Magical Record, it instantiates immutable model which is completely legit and then copies some NSEntityDescriptions. Which causes initialization to fail because it is an NSObject and uses copyWithZone:. That calls implementation from NSObject+RMCopyable and that crashes because it uses setValue:forKey: which can't be used as model is immutable.

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

1 participant