Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "attribute" and "property" in restkit

Tags:

ios

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.

like image 240
Ray Shih Avatar asked Jan 02 '13 13:01

Ray Shih


1 Answers

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.

like image 163
kurige Avatar answered Sep 28 '22 01:09

kurige