ios - deinit in Swift behavior -
i wrote following code in swift playground
:
class view : uiview { let name = "myview" deinit { print("deinit view") } } class controller: nsobject { var view: view init(view : view) { self.view = view super.init() } deinit { print("deinit controller") } } var c : controller? = controller(view: view()) c = nil
the console shows :
deinit controller
my question shouldn't below ?
deinit controller deinit view
Comments
Post a Comment