Closed qszdjj closed 4 years ago
(instancetype)prop:(objc_property_t)prop { OBJCProperty p = [[OBJCProperty alloc] init]; p->_prop = prop; p->_name = [NSString stringWithUTF8String:property_getName(prop)]; p->_attributeDict = [NSMutableDictionary dictionary]; unsigned int outCount; objc_property_attribute_t attrs = property_copyAttributeList(prop, &outCount); for (int i = 0; i < outCount; i++) { objc_property_attribute_t attr = attrs[i]; p->_attributeDict[TONSString(attr.name)] = TONSString(attr.value).length ? TONSString(attr.value) : @"";
} free(attrs); return p; }
所有没写入数据库的String,好像ivarName是null,目前我调试出来的问题是这样的。把String改为NSString又可以了。但xcode 10不会这样。
(instancetype)prop:(objc_property_t)prop { OBJCProperty p = [[OBJCProperty alloc] init]; p->_prop = prop; p->_name = [NSString stringWithUTF8String:property_getName(prop)]; p->_attributeDict = [NSMutableDictionary dictionary]; unsigned int outCount; objc_property_attribute_t attrs = property_copyAttributeList(prop, &outCount); for (int i = 0; i < outCount; i++) { objc_property_attribute_t attr = attrs[i]; p->_attributeDict[TONSString(attr.name)] = TONSString(attr.value).length ? TONSString(attr.value) : @"";
} free(attrs); return p; }
所有没写入数据库的String,好像ivarName是null,目前我调试出来的问题是这样的。把String改为NSString又可以了。但xcode 10不会这样。