Can I still use xcdatamodel core data model relationships with Restkit?
Asked Answered
G

2

6

As I understand it RestKit provides integration with Apple’s Core Data framework, making and populating Core Data associations for you, allowing natural property based traversal of your data model.

However, I am unsure if I can still use xcdatamodel with RestKit, and cannot find any references, tutorials on whether RestKit can use xcdatamodel (Core data modelling tool) or not.

My prototype app is a company structure app; ie:

Company -< Departments -< Employees
Company -< Suppliers
..etc

In addition, I have set up some simple Fetched Properties/Templates to gather specific data; however I am unsure if I start using RestKit whether I can still use these tools/techniques via xcdatamodel, or rather I will have to code them manually.

My question therefore is, can I still model my complex app/data using xcdatamodel, complete with the fetched properties, etc and then make RestKit talk to it; and if so, can someone help point to a tutorial site about this?

Thanks.

Greenockite answered 17/7, 2011 at 8:43 Comment(0)
B
5

Yes, you can use xcdatamodel. Look at RKCatalog example app - RKCoreDataExample uses it without any problems.

Biddie answered 17/7, 2011 at 13:11 Comment(0)
M
0

You can also use mogenerator tool. Where in "machine" files will be all the CoreData mechanics, and in "humain" files will be configuration of RestKit-related stuff.

Mcnulty answered 18/1, 2012 at 15:32 Comment(1)
Don't the RestKit managed objects need to inherit from RKManagedObject? mogenerator produces classes which inherit from NSManagedObject.Fleming

© 2022 - 2024 — McMap. All rights reserved.