About the object sequence in the RestKit

孤人 提交于 2019-11-29 15:57:33

You should add sortID to the object - this is the appropriate solution. To populate it with a value you need to use the @metadata made available to your mappings:

@"@metadata.mapping.collectionIndex" : @"sortID"

This code assumes that you are specifying your mapping with a dictionary (addAttributeMappingsFromDictionary:).

Documented here, the collectionIndex provides you with an NSNumber representing the order of the item in the response data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!