在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
import UIKit
class ViewController: UIViewController {
//静态变量 swift中的static静态变量,只能在这里声明,不能在方法中声明,会报错 static var i : Int = 1
override func viewDidLoad() { super.viewDidLoad()
//调用静态变量 // print(self.i) 错 print(ViewController.i) //这样调用
// Do any additional setup after loading the view, typically from a nib. }
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }
}
|
请发表评论