objective-c - dismissViewControllerAnimated execution has delay
天蓬老师
天蓬老师 2017-05-02 09:27:55
0
1
746

Clicked the tableView in

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

Execute

[self dismissViewControllerAnimated:YES completion:nil];

The current interface will not close immediately and there will be a 3-4s delay. If you click anywhere on the current interface again, it will close immediately.

This problem does not occur when using Button to execute the above code to close it.

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
大家讲道理

I also encountered the exact same problem. It can be solved by adding the following

dispatch_async(dispatch_get_main_queue(), ^{
        [self dismissViewControllerAnimated:NO completion:nil];
    });

I have also printed that the threads are all main threads, but I don’t understand why such a problem occurs
<NSThread: 0x17007a040>{number = 1, name = main}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template