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

对于Int可选型就不能赋值 #6

Open
HLoveMe opened this issue Dec 29, 2015 · 2 comments
Open

对于Int可选型就不能赋值 #6

HLoveMe opened this issue Dec 29, 2015 · 2 comments

Comments

@HLoveMe
Copy link

HLoveMe commented Dec 29, 2015

我自己写的OC版本在swift不能运行 ,看了一下午 源代码,还是和我的问题一样。对于类的属性有Int是可选型 直接崩溃 。

@lizzie8023
Copy link

试试给你的类属性是int类型的赋一个初始值 不要使用可选 例如 var age:Int = 0

@HLoveMe
Copy link
Author

HLoveMe commented Dec 30, 2015

不是可选型是可以赋值的 我就是想知道 对于可选型能否进行赋值操作

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