Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a UITableViewController in a Storyboard. I have the selection of my UITableViewCell prototype trigger a segue to present another controller. The presentation itself is working.

I noticed a strange bug (possibly introduced in iOS 8) that tapping on the cell highlights the cell as expected but sometimes takes several seconds before performing the segue. Tapping on the cell twice causes the segue to happen immediately.

Has anyone else noticed this in iOS 8?

EDIT: I've now noticed that it is not just a double tap that triggers the segue faster. It is also a tap on the cell followed by a swipe anywhere. Starting to seem like a threading issue to me...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
575 views
Welcome To Ask or Share your Answers For Others

1 Answer

In my case, the solution ended up being to call performSegue manually from didSelectRow on the main queue using GCD instead of using the UITableViewCell selection outlet in Storyboard.

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  dispatch_async(dispatch_get_main_queue(), ^{
    [self performSegueWithIdentifier:kShowDetailSegue
                          sender:nil];
  });
}

I'm not sure why this became necessary- certainly you'd think that the selection outlet in Storyboard would operate on the main queue, but maybe it is an iOS 8 bug.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...