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

无法转换Optional;toDict问题 #8

Open
lxlx5434 opened this issue Mar 9, 2016 · 1 comment
Open

无法转换Optional;toDict问题 #8

lxlx5434 opened this issue Mar 9, 2016 · 1 comment

Comments

@lxlx5434
Copy link

lxlx5434 commented Mar 9, 2016

  1. 在parse2中:
    var bag: Bag
    改为:
    var bag: Bag?
    运行崩溃。
  2. toDict方法得到的数据类型是[String: Any],Int、Double、String等等都转成了字符串,丢失了数据类型;无法使用该dict转换到model。
@lxlx5434
Copy link
Author

lxlx5434 commented Mar 9, 2016

对于第二个问题toDict,我是用valueForKeyPath获取值的,这个方法反回AnyObject,能够保留数据类型,还能够通过生成的dict来还原model。

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

1 participant