-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
goalvc was crashing when refreshing its ui for an unavailable goal #596
goalvc was crashing when refreshing its ui for an unavailable goal #596
Conversation
self.datapointTableController.datapoints = goal.recentData.sorted(by: {$0.updatedAt < $1.updatedAt}) | ||
@MainActor func updateInterfaceToMatchGoal() { | ||
self.datapointTableController?.hhmmformat = goal.hhmmFormat | ||
self.datapointTableController?.datapoints = goal.recentData.sorted(by: {$0.updatedAt < $1.updatedAt}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.datapointTableController?.datapoints = goal.recentData.sorted(by: {$0.updatedAt < $1.updatedAt}) | |
self.datapointTableController?.datapoints = goal.recentData.sorted(using: SortDescriptor(\.updatedAt)) |
@@ -312,6 +315,9 @@ class GoalViewController: UIViewController, UIScrollViewDelegate, DatapointTabl | |||
super.viewDidDisappear(animated) | |||
lastUpdatedTimer?.invalidate() | |||
lastUpdatedTimer = nil | |||
datapointTableController?.delegate = nil | |||
datapointTableController = nil | |||
NotificationCenter.default.removeObserver(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NotificationCenter.default.removeObserver(self) |
docs point out that modern iOS versions take care of this automatically
Are you able to reliably repro the crash? If so, what does the memory debugger show at the time? I'm very open to the idea this patch is correct, but would like to understand why. |
no, apparently not. |
Summary
Despite the changes in #591, a crash was still observed.
For UI changes including screenshots of before and after is great.
Validation
added logging to validate vc being deallocated when expected
in simulator, navigated gallery to goal and back and forth again
#590