From 2ea64a4c20ecdcce48d0e9bb58b31bf3fe60620a Mon Sep 17 00:00:00 2001 From: John McKerrell Date: Mon, 14 Sep 2015 11:43:00 +0100 Subject: [PATCH] Fix issue with property values being associated with the class not the instance. --- DZLCategoryProperties/NSObject+DZLCategoryProperties.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DZLCategoryProperties/NSObject+DZLCategoryProperties.m b/DZLCategoryProperties/NSObject+DZLCategoryProperties.m index dc2141c..aac096a 100644 --- a/DZLCategoryProperties/NSObject+DZLCategoryProperties.m +++ b/DZLCategoryProperties/NSObject+DZLCategoryProperties.m @@ -119,7 +119,7 @@ + (void)implementGetterIfNecessaryForPropertyName:(char const *)propertyName cus { SEL getter = NSSelectorFromString(customGetterName ?: [NSString stringWithFormat:@"%s", propertyName]); [self implementMethodIfNecessaryForSelector:getter parameterTypes:NULL block:^id(id _self) { - return objc_getAssociatedObject(self, key); + return objc_getAssociatedObject(_self, key); }]; } @@ -137,7 +137,7 @@ + (void)implementSetterIfNecessaryForPropertyName:(char const *)propertyName cus SEL setter = NSSelectorFromString(customSetterName ?: [NSString stringWithFormat:@"set%c%s:", toupper(*propertyName), propertyName + 1]); [self implementMethodIfNecessaryForSelector:setter parameterTypes:"@" block:^(id _self, id var) { - objc_setAssociatedObject(self, key, var, associationPolicy); + objc_setAssociatedObject(_self, key, var, associationPolicy); }]; }