Swift中的 "dealloc"

OC中对象销毁时会调用 dealloc 方法,此方法在实际开发中主要作用就是判断有无循环引用造成内存泄露。


Swift中 deinit 可以实现 “dealloc” 的功能

deinit {
        println("没有循环引用")
    }