Skip to content

Commit

Permalink
Fixing problem that all properties shared same value, issue samdods#3.
Browse files Browse the repository at this point in the history
  • Loading branch information
John McKerrell committed Sep 14, 2015
1 parent 657cedf commit ac620d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions DZLCategoryProperties/NSObject+DZLCategoryProperties.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ + (void)implementAccessorsIfNecessaryForProperty:(objc_property_t)property
return;
}

const void *key = &key;
key++;

const char *name = property_getName(property);

// Creating a selector from the name of the property seems reasonable,
// even if they've created a custom getter or setter it's unlikely that they
// have another associated object with the same name.
const void *key = NSSelectorFromString([NSString stringWithFormat:@"%s", name]);

[self implementGetterIfNecessaryForPropertyName:name customGetterName:customGetterName key:key];

BOOL isReadonly = [attributes containsObject:@"R"];
Expand Down

0 comments on commit ac620d1

Please sign in to comment.