Skip to content
New issue

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时发现了一个bug #31

Open
740629515 opened this issue Jan 10, 2018 · 1 comment
Open

在使用关系型 property时发现了一个bug #31

740629515 opened this issue Jan 10, 2018 · 1 comment

Comments

@740629515
Copy link

2018-01-10 3 21 05

对于关系型 property,需要在实现里定义为 dynamic. 这样的话编译器就不会自动生成实例变量以及存取方法了.我看源码里面是在运行期做的相关处理.

如图中红色圈圈处所示, 假如当我的关系型property命名为 "lastName" 时, "lastName" 直接调用 capitalizedString 方法后变为 "Lastname", 完成set拼接之后, 最后拿到的是 "setLastname:", 而其实我们需要拼接出来的应该是 "setLastName:". 所以当关系型property名不止为一个词时, 就会crash. 当然如果关系型property不用驼峰命名法的话, 不会.....

修改方案啦~
2018-01-10 6 10 42

@shixiaoda
Copy link

这个bug其实master分支里面已经修复,cocospod不知道为什么没有更新

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants