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

Unacceptable type of value for to-one relationship #7

Closed
emilpedersen opened this issue Jul 19, 2015 · 4 comments
Closed

Unacceptable type of value for to-one relationship #7

emilpedersen opened this issue Jul 19, 2015 · 4 comments
Labels

Comments

@emilpedersen
Copy link

When I try to edit and TimeEntry i get this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for to-one relationship: property = "project"; desired type = TimeTarget.Project; given type = TimeTarget.Project; value = (entity: Project; id: 0x174426160 x-coredata://6B81EA38-15B7-4C85-ADB5-6640EE31DF5D-9088-000002BEECC9720D/Project/p254230CF-A9CD-4CAD-B47F-19DFBA054081 ; data: {
billable = 0;
"cks_LocalStore_Attribute_ChangeType" = nil;
"cks_LocalStore_Attribute_EncodedValues" = nil;
"cks_LocalStore_Attribute_RecordID" = nil;
client = "0x174239480 x-coredata://6B81EA38-15B7-4C85-ADB5-6640EE31DF5D-9088-000002BEECC9720D/Client/p686DBB54-ACC5-4313-8369-2DF9B8003E4B";
color = 0;
defaultHourRate = 0;
name = Kk;
timeEntries = "";
}).'

And same when I try an edit an Project:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for to-one relationship: property = "client"; desired type = TimeTarget.Client; given type = TimeTarget.Client; value = (entity: Client; id: 0x174621ac0 x-coredata://17D56827-FF19-4DDD-8161-E4C930BC4398-9102-000002BF85C10C71/Client/p686DBB54-ACC5-4313-8369-2DF9B8003E4B ; data: {
billable = 0;
color = 0;
defaultHourRate = 0;
name = Klkj;
projects = (
"0x170432e00 x-coredata://17D56827-FF19-4DDD-8161-E4C930BC4398-9102-000002BF85C10C71/Project/p9E6EA418-FF51-492C-84ED-575A76659490",
"0x170432e20 x-coredata://17D56827-FF19-4DDD-8161-E4C930BC4398-9102-000002BF85C10C71/Project/p254230CF-A9CD-4CAD-B47F-19DFBA054081"
);
}).'

The client I can edit / save without problem. It first happens when I have closed the app and reopened the app again.

Model:
1f1e4122-2db4-11e5-9773-68432c8cc9c9

@nofelmahmood
Copy link
Owner

This might help.

@emilpedersen
Copy link
Author

Can't get it to work.
It works without CKSIncrementalStore. With CKSIncrementalStore it only works until I restart the app.

nofelmahmood pushed a commit that referenced this issue Jul 19, 2015
@nofelmahmood
Copy link
Owner

I have checked. I think this is not a bug. I checked by changing the model with to one and a to many inverse relationship. I also tried re starting the demo app several times and changing values for to many and to one relationships. All worked fine. I have updated the demo btw. You can also try out it over there.
Please double check your CoreData model. This helped me too. Please also check that if you are using the same instance of NSManagedObjectContext to modify the objects.

@nofelmahmood
Copy link
Owner

Sorry you were right this was a CKSIncrementalStore bug. Check the latest build now and post feedback here :)

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

No branches or pull requests

2 participants