From d687aeabf9aa40d618c19cf5d5f8c4cfea58018f Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Thu, 29 Nov 2018 11:50:59 +0100 Subject: [PATCH] fix crash: scrollToRowAtIndexPath needs to be used in main thread --- LiblinphoneTester/DetailTableView.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LiblinphoneTester/DetailTableView.m b/LiblinphoneTester/DetailTableView.m index a5873164b..784564265 100644 --- a/LiblinphoneTester/DetailTableView.m +++ b/LiblinphoneTester/DetailTableView.m @@ -215,8 +215,9 @@ static NSString *const kAllTestsName = @"Run All tests"; LOGI(@"Test Passed!"); test.state = TestStatePassed; } - [self.tableView scrollToRowAtIndexPath:index atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.tableView scrollToRowAtIndexPath:index atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; [self updateItem:paths withAnimation:TRUE]; }); }