objective-c - dismissViewControllerAnimated执行有延迟
天蓬老师
天蓬老师 2017-05-02 09:27:55
0
1
715

点击了tableView在

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

执行

[self dismissViewControllerAnimated:YES completion:nil];

当前界面不会立即关闭有3-4s延迟,如果再次点击当前界面上任意位置,就会立即关闭。

使用Button执行上面代码进行关闭的时候不出出现这个问题。

天蓬老师
天蓬老师

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

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