1

I am searching for more information on how to use AFIncrementalStore. I need to know how to implement it step by step.

If I understood right AFIncrementalStore it is a layer for fetching data from the server and for the mapping data model. Am I right?

So I have few URL that I need to mapping into my local model. All of them use GET requests.

For example base_url/api/categories

I get this string in response:

[{"category":{"name":"3d max","id":"1111001","users":[]}},
{"category":{"name":"photoshop","id":"1111002","users":[]}},
{"category":{"name":"auto cad","id":"1111003","users":[]}}]

So, how I can binding my local db with this data using AFIncrementalStore? Also if you can see there are relationships in the response string that are connected to uses. The array for users will contain id that is correspond to concert users. So I think second question is how to point that model has to have relationship.

halfer
  • 19,824
  • 17
  • 99
  • 186
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
  • Edited your question since you shouldn't ask for tutorials or links to tutorials. – iwasrobbed Oct 27 '13 at 13:56
  • By the way, @Mattt has included a good example here: https://github.com/AFNetworking/AFIncrementalStore/blob/master/Examples/Twitter%20Client/Classes/AppDotNetAPIClient.m – iwasrobbed Oct 27 '13 at 14:22
  • @iWasRobbed if i understood right i can pull data from the server. But how it understands which service it will grab, based just one one url in the code. For example if i need to pull data for Photo entity and for Car entity. How it will work in this case? – Matrosov Oleksandr Nov 05 '13 at 21:55

1 Answers1

0

I have found this explanation:

link

But can I pull data from the server and how it understands that afincremenalstore needs to pull data for entity for example from http://api/categories or in another case http://api/photo for the Photo entity?

Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277