简体   繁体   中英

What's the difference between “attribute” and “property” in restkit

I am new for iOS RestKit framework. I have read the document and still can not figure out the differences between "attribute" and "property" in RestKit.

Since in the document, there are

- addPropertyMappingsFromArray:

and

– addAttributeMappingsFromArray:

I know that while assigning relationship, I should use the first one. However, I still cannot truly understand the differences.

I just ran into this myself. The naming could definitely be clearer.

- addAttributeMappingsFromArray: refers to what you would expect: mappings of class attributes. - addPropertyMappingsFromArray: on the other hand refers to RKPropertyMapping objects.

If you take a look at the RestKit source you'll see that all the 'addAttributeMappings' methods are a handy abstraction on top of the 'addPropertyMappings' methods, and take care of constructing the required RKPropertyMapping objects for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM