Open dev-zlcode opened 6 years ago
#ifndef YYSYNTH_DYNAMIC_PROPERTY_CTYPE #define YYSYNTH_DYNAMIC_PROPERTY_CTYPE(_getter_, _setter_, _type_) \ - (void)_setter_ : (_type_)object { \ [self willChangeValueForKey:@#_getter_]; \ NSValue *value = [NSValue value:&object withObjCType:@encode(_type_)]; \ objc_setAssociatedObject(self, _cmd, value, OBJC_ASSOCIATION_RETAIN); \ [self didChangeValueForKey:@#_getter_]; \ } \ - (type)_getter_ { \ _type_ cValue = { 0 }; \ NSValue *value = objc_getAssociatedObject(self, @selector(_setter_:)); \ [value getValue:&cValue]; \ return cValue; \ } #endif _getter_的返回值应该是_type_
把(type)getter改成(type)_getter_就好了