hard20 pts · first answer countsswiftmemory-management
Memory leak with a closure
This view controller is never deallocated after it is dismissed. Why?
class ProfileVC: UIViewController {
var onUpdate: (() -> Void)?
override func viewDidLoad() {
super.viewDidLoad()
onUpdate = {
self.reload()
}
}
func reload() {}
}Discussion 0
Join free to post in the discussion.
Related questions
- Safely unwrapping a Swift optionalMobile App Developer
- Swift struct assignment copiesMobile App Developer
- Swift class shared referenceMobile App Developer
- Decoding JSON with extra keysMobile App Developer
- unowned self in a network callbackMobile App Developer
- When a Swift array is copiedMobile App Developer
- Dynamic memory on small MCUsEmbedded Systems Engineer
- Size of a structEmbedded Systems Engineer