mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-01 09:31:17 +08:00
Since OM 2.0 connection of relationships happened during the object mapping operation instead of aggregately at the end of the process. In this commit, we have introduced a lightweight queue for deferring portions of the mapping operation until a larger aggregate mapping has completed. The changes are as follows: * Introduced RKMappingOperationQueue for queueing portions of mapping. This is a synchronous queue modeled off of NSOperationQueue that does NOT use threading (for Core Data friendliness). * RKObjectMappingOperation now has a RKMappingOperationQueue queue property that defaults to nil * RKObjectMappingOperation instances built via RKObjectMapper will has a mapping operation queue assigned to the property. * If a queue is present, RKManagedObjectMappingOperation will use it to defer the connection of relationships. * At the end of an RKObjectMapper process, the mapping operation queue used by all mapping operations created during the process will be executed. This allows all relationships to be connected after all object creation has completed. The queue is general purpose, though currently only used for the connection of relationships.