Comments (2)
我也遇到了,怎么解决
from coremodel.
目前有一取巧方法:在NSObject+Runtime.m文件的+(void)enumerateCls: propertyBlock:的实现代码改成:
+(void)enumerateCls:(Class)cls propertyBlock:(void(^)(CoreProperty *p))propertyBlock{
unsigned int numIvars; //成员变量个数
Ivar *vars = class_copyIvarList(cls, &numIvars);
//Ivar *vars = class_copyIvarList([UIView class], &numIvars);
NSString *key=nil;
NSString *type = nil;
for(int i = 0; i < numIvars; i++) {
//创建CoreProperty
CoreProperty *p =[CoreProperty new];
Ivar thisIvar = vars[i];
key = [NSString stringWithUTF8String:ivar_getName(thisIvar)]; //获取成员变量的名字
if ([[key substringWithRange:NSMakeRange(0, 1)] isEqualToString:@"_"]) {
key = [key substringFromIndex:1];
}
//记录变量名
p.name = key;
type = [NSString stringWithUTF8String:ivar_getTypeEncoding(thisIvar)]; //获取成员变量的数据类型
//处理并记录变量类型
p.code = type;
propertyBlock(p);
}
free(vars);
}
添加了
if ([[key substringWithRange:NSMakeRange(0, 1)] isEqualToString:@"_"]) {
key = [key substringFromIndex:1];
}
只去掉第一个 _
from coremodel.
Related Issues (20)
- (2). 开源第四季动态缓存的条件为:CoreModel的Star数据超过1000。
- select查找的一个BUG
- 条件查询的时候selectResultsBlock 会走好多次 HOT 1
- sql语句中会出现单引号错误
- 下载你的最新代码 出现bug HOT 3
- 5s 测试出现bug HOT 1
- 最新版本的好像有BUG HOT 7
- 删除app后重新安装,出现bug HOT 1
- 会导致随机crash,原因貌似是MJProperty的问题 HOT 2
- 能设置忽略属性吗
- selectWhere: 这个查询方法怎么用呢 HOT 2
- 谁能说说 LKDBHelper 和CoreModel的不同
- 属性是int时对应的数据库中类型是text类型
- 模型级联失效 HOT 1
- 创建表崩在这 HOT 2
- 模型级联失败BUG 问题所在位置
- 不支持NSNumber吗?
- 那么多警告。。。能解决一下吗作者。呜呜 HOT 1
- 请问作者你这个怎么转模型?还是用MJExtention转模型吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coremodel.