DataStore-DataSource Pushing Data


TODO:  Flush out with details and examples.  Any takers to help?

 

Anytime you receive data from your server that the store did not specifically ask you to retrieve or update, you need to push it in to the store.  Pushing differs from retrieving data in that a record could be in any state when you try to push it; not just BUSY.

 

To push data into the store, use one of pushRetrieve(), pushError(), or pushDestroy().  Pass storeKeys.  pushRetrieve also has you include data hashes.  

 

If you try to push data to a storeKey that can't take your data.  (let's say its been modified in memory and pushing data would override the changes), the method will return NO indicating an error.  You should choose how to resolve it.

 

Calling loadRecords() to load data can be used instead of pushRetrieve() OR dataSourceDidComplete().  loadRecords() inspects the status of each record and calls the proper method. 

 

Moving On 

 

You done with the core programming guide!

Back to DataStore Programming Guide Home ยป