Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between RestKit and AFIncrementalStore

In my iOS app, I am trying to get and post data from a (RESTful) server. I think for that both RestKit and AFIncrementalStore are good candidates. However I also need to be able to save data offline and push it to the server when the app is online.

I am trying to understand which is a better framework to use for the application.

Also, from some of the online resources, it seems that using faulting on AFIncrementalStore could potentially cause the thread handling ManagedContext (usually the mainThread) to get stuck while furnishing the network request to get a property. Is it a big deal?

PS: Adding afnetworking tag since afincrementalstore tag is not available

like image 352
Devang Avatar asked Dec 13 '12 09:12

Devang


1 Answers

AFIncrementalStore works within Core data, sending back to your Web service. It uses the relatively new API Apple provides called NSIncrementalStore.

RestKit works from outside Core Data, binding HTTP requests to Core Data loosely using the object mapping architecture RK provides.

Here are some pros & cons for both:

  • New RestKit version (0.2.x) is ligther than the 0.1 version
  • RestKit now use the really good AFNetworking for all his HTTP request work, just like AFIncrementalStore.
  • ResKit has A LOT of test coverage
  • AFIS is really light since it's built on NSIncrementalStore
  • AFIS give you a bit more flexibility, since you're pretty much on your own
  • RestKit is pretty huge and can be scary at first
  • RestKit is a complete solution, but takes time to fully wrap your head around all its concepts

My final recommendation would be to take the time and try both. What I can confirm is you'll need to drop a bit more lines of code using AFIS, since it does not take you by the hand as much as RestKit, so it's really a matter of preference.

Hope this will help you make the right choice!

like image 132
allaire Avatar answered Oct 12 '22 01:10

allaire