JTObjectMapping icon indicating copy to clipboard operation
JTObjectMapping copied to clipboard

Ignore certain keys

Open mwhuss opened this issue 10 years ago • 4 comments

I'm using this on a NSManagedObject subclass. It's trying to take an array of objects and set them on my object, but the property is an NSSet. This results in the follow exception:

'Unacceptable type of value for to-many relationship: property = "inProgressSyllabi"; desired type = NSSet; given type = __NSArrayI;

mwhuss avatar Jul 22 '14 17:07 mwhuss

@mwhuss Have you tried JTSetMappings? (Here's an example from the tests.)

zcharter avatar Jul 23 '14 00:07 zcharter

I'm handling the creation and setting of those objects myself when doing a sync from the API. They're constructed from JSON and all the correct CoreData associations are setup. I'd much prefer a way to say "don't touch this key, I'll handle it".

mwhuss avatar Jul 23 '14 14:07 mwhuss

It's also worth noting that I don't have this issue in v1.1.1, it only started occurring in v1.1.2.

mwhuss avatar Jul 23 '14 14:07 mwhuss

v1.1.2 may have something to do with auto underscore mapping. Can you provide an example schema of your managed object and a sample JSON?

jamztang avatar Jul 25 '14 00:07 jamztang