krzysztofzablocki / PropertyMapper

Property mapping for Objective-C iOS apps.
http://merowing.info
MIT License
1.13k stars 81 forks source link

Give readonly access to .propertyName of KZPropertyDescriptor #48

Closed ilyannn closed 9 years ago

ilyannn commented 9 years ago

Hey, I don't think there can be any harm if outside classes had access to propertyName.

I need to use it in the following situation: extract the external primary key from the mapping dictionary, given that we know internal primary key. That is:

        [mapping enumerateKeysAndObjectsUsingBlock:^(id key, KZPropertyDescriptor *description, BOOL *stop) {
             if ([description isKindOfClass:[KZPropertyDescriptor class]] &&
                 [description.propertyName isEqualToString:modelPrimaryKey])
             {
                 externalPrimaryKey = key;
                 *stop = YES;
             }
         }];

Do you mind merging it?

Thanks fot great work!