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.

zardon
  • 2,910
  • 6
  • 37
  • 58

2 Answers2

5

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

Victor K.
  • 4,054
  • 3
  • 25
  • 38
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.

Artem Oboturov
  • 4,344
  • 2
  • 30
  • 48
  • Don't the RestKit managed objects need to inherit from RKManagedObject? mogenerator produces classes which inherit from NSManagedObject. – Aneil Mallavarapu Aug 31 '13 at 00:20