Memory and ARC
When deinit runs
What does this code print?
final class Session { deinit { print("bye") } }
var a: Session? = Session()
var b = a
a = nil
print("1")
b = nil
print("2")Pick one
When deinit runs
What does this code print?
final class Session { deinit { print("bye") } }
var a: Session? = Session()
var b = a
a = nil
print("1")
b = nil
print("2")Pick one
ArchitectureMultiple choiceBasics
For a singleton of the form static let shared = SessionManager(), someone asks "can you m…
#deinit #lifetime
Memory and ARCShort answerIntro
What is ARC, and why do we need it?
#lifetime
Memory and ARCShort answerBasics
A view controller doesn't seem to leave memory after you close its screen. How would you …
#deinit
Memory and ARCShort answerBasics
When would you use unowned instead of weak?
#lifetime