开发过程中所遇到的程序奔溃

this class is not key value coding-compliant for the key age.

解决方法:一般此问题是字典转model出错,如使用了Int型变量,但是却没有赋初值

 

fatal error: unexpectedly found nil while unwrapping an Optional value

解决方法:swift中有个命名空间。所有的控制器名字都有个项目的前缀。通过NSBundle.mainBundle().infoDictionary!["CFBundleName"] as! String 获得前缀名后,拼接上现在的控制器名字即可

posted @ 2016-07-21 19:53  程春玉  阅读(38)  评论(0编辑  收藏  举报