We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在我的项目中使用的时候发现查找property的时候还查找了类实现的protocol的property,导致调用valueForKey的时候crash
The text was updated successfully, but these errors were encountered:
static BOOL _property_hasGetterOrRetainedIvar(objc_property_t property) { if (property == NULL) { return NO; } const char *attrs = property_getAttributes(property); if (attrs == NULL) { return NO; } // Check dynamic const char *dynamic = strstr(attrs, ",D"); if (dynamic != NULL) { return NO; } // Check getter const char *getter = strstr(attrs, ",G"); if (getter != NULL) { return YES; } // Check retained and ivar const char *retained = strchr(attrs, '&'); const char *ivar = strstr(attrs, ",V"); if (retained != NULL && ivar != NULL) { return YES; } return NO; }
使用上边这个方法替换bool isStrongProperty(objc_property_t property)方法试下
bool isStrongProperty(objc_property_t property)
Sorry, something went wrong.
No branches or pull requests
在我的项目中使用的时候发现查找property的时候还查找了类实现的protocol的property,导致调用valueForKey的时候crash
The text was updated successfully, but these errors were encountered: