Post

Replies

Boosts

Views

Activity

Reply to Tracking down a memory leak
Hi @Developer Tools Engineer, memory graph debugger can't capture leaks on my simple demo: I have 2 view controllers. View controller 1 is the root view controller of the app View controller 1 will use navigation controller to push to view controller 2 (which has retain cycle between itself and a closure) However, after I tap "Back" button in the navigation controller to go back to view controller 1 -> Memory graph debugger not show "ViewController2" as leak. Things to note here: This is leaks, not abandoned memory (since we can't not access to view controller 2) from anywhere else. So I wonder why Memory Graph Debugger doesn't work on this simple demo? This is the code of the sample project: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func didTapButton(_ sender: Any) { let vc2 = ViewController2() navigationController?.pushViewController(vc2, animated: true) } } final class ViewController2: UIViewController { private var callback: (() -> Void)? override func viewDidLoad() { super.viewDidLoad() callback = { self.view.backgroundColor = .red // retain cycle here } } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’23
Reply to Tracking down a memory leak
Hi @Developer Tools Engineer, memory graph debugger can't capture leaks on my simple demo: I have 2 view controllers. View controller 1 is the root view controller of the app View controller 1 will use navigation controller to push to view controller 2 (which has retain cycle between itself and a closure) However, after I tap "Back" button in the navigation controller to go back to view controller 1 -> Memory graph debugger not show "ViewController2" as leak. Things to note here: This is leaks, not abandoned memory (since we can't not access to view controller 2) from anywhere else. So I wonder why Memory Graph Debugger doesn't work on this simple demo? This is the code of the sample project: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func didTapButton(_ sender: Any) { let vc2 = ViewController2() navigationController?.pushViewController(vc2, animated: true) } } final class ViewController2: UIViewController { private var callback: (() -> Void)? override func viewDidLoad() { super.viewDidLoad() callback = { self.view.backgroundColor = .red // retain cycle here } } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to WWDC 2015 video on GCD missing (again)
I emailed to Quinn 1 month ago to ask about this video too. He said that he will ask his colleagues to bring to video back. Now I'm waiting for it
Replies
Boosts
Views
Activity
Sep ’23
Reply to WWDC 2015 video on GCD missing (again)
Yeah, I'm looking for that video too
Replies
Boosts
Views
Activity
Sep ’23