美文网首页
我的swift

我的swift

作者: 小番茄加西红柿 | 来源:发表于2016-12-29 15:05 被阅读8次

1、处理内存不足的接口:didReceiveMemoryWarning

//处理内存不足的接口:内存不足时,调用到此方法

override func didReceiveMemoryWarning() {

super.didReceiveMemoryWarning()//ios6.0以上调用didReceiveMemoryWarning内调用super的didReceiveMemoryWarning调只是释放controller的resouse,不会释放view

// Dispose of any resources that can be recreated.

print("内存不足时将会执行此代码")

}

2、let 是声明常量;var是声明变量。

let name = "林俊杰"

let age = 22

print("姓名:",name,"\n年龄:",age)

3、类型转换

//Int转换为String

let count : Int = 100

let num : String = String(count)

print(num+"分")

相关文章

网友评论

      本文标题:我的swift

      本文链接:https://www.haomeiwen.com/subject/bsqpvttx.html