Skip to content

Error on non existing relationship #12

@Ma-He

Description

@Ma-He

I've got a 'Person' entity with a relationship to a 'Location' entity. But in some cases a 'Person' entity can exists without a 'Location' entity. That's why my JSON model doesn't provide a 'location' key for certain persons.

When I try to deserialize a JSON 'Person' into a ManagedObject without a given location relationship, I get the following error:

*** Assertion failure in -[FEMCache addExistingObject:usingMapping:], /.../FEMCache.m:185
2014-09-08 15:30:47.906 AppName[7866:3191678] 
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No value for key (locationId) on object (<Location: 0x1782d8330> (entity: Location; id: 0x178826480 <x-coredata:///Location/t149B2931-DA62-4EFC-8C7D-3CFC8058F57A16> ; data: {
city = nil;
country = nil;
houseNumber = nil;
latitude = nil;
locationId = nil;
longitude = nil;
relatedParkingSlot = nil;
streetName = nil;
zipCode = nil;
})) found'

Any suggestions on this?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions