1

When doing managed objectmapping with RestKit, using core data, i map using my NSManaged subclasses fe. User.m And that works fine.

But if i need to do ordinary objectmapping it is not possible to still use the NSManaged Subclass - User.m, as the mapping object. I then have to create a new object, subclassing NSObject, with the exact same ivars i.e. UserOBJmapping.m

This is kind of a waste, and i wonder if there is a more clever way to do it, so i do not have to create classes that have the same internal structure.

The reason why i have to do this, is that whenever RestKit maps an incoming objectstream to User, it is put directly in the store, and i have situations where i need the data not to be store, but simply be in my cache memory for manipulation. Just like i do with normal Object Mapping. I think there properly is a way to do this with managed objects in RestKit but have found no info about it anywhere. I hope that someone might have a some idea for achieving a more clever solution.!

Thanx

Thomas
  • 75
  • 7

1 Answers1

0

It's a limitation in Core Data. You can't have NSManagedObject instances without a context.

Can RestKit map to a dictionary instead?

paulmelnikow
  • 16,895
  • 8
  • 63
  • 114