swift是类型安全语言佐证
2015-11-14 17:44
246 查看
swift中赋值操作是没有返回值的
在OC中,非0即为真
int a = 10;
int b = a = 10;
but..在swift中是不成立的,因为a = 10 并没有返回值,所以b = null
and
int a = 10;
int b = 15;
if (a == b){
//...在swift中如果上面判断条件误写为 a = b ,无返回值,即 if ( )
}
在OC中,非0即为真
int a = 10;
int b = a = 10;
but..在swift中是不成立的,因为a = 10 并没有返回值,所以b = null
and
int a = 10;
int b = 15;
if (a == b){
//...在swift中如果上面判断条件误写为 a = b ,无返回值,即 if ( )
}
相关文章推荐
- swift-UINavigationController纯代码自定义导航控制器及底部工具栏的使用
- 13、swift语言中类的继承
- Snail—Swift基础学习之初识
- ios面向切面AOP(下) swift版本
- oc调用swift
- Swift快速入门
- swift数据类型
- swift中操作string
- 开始swift学习之路
- 图形的绘制(包括线段 圆形 矩形等) swift编写
- swift-教你如何实现导航上的UISearchController动画效果。
- SWIFT——函数
- swift 泛型
- swift 泛型
- swift 自行理解
- swift 自行理解
- swift变量交换赋值
- swift变量交换赋值
- swift 上传文件到服务器
- Swift Protocol optional