ios – 单击时未调用UITableView didSelectRowatIndexPath

ios – 单击时未调用UITableView didSelectRowatIndexPath,第1张

概述非常奇怪!它适用于所有地方但在这里 - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ MyViewController* cliente = [[MyViewController alloc] initWithModeAndClientId:2 c:cid 非常奇怪!它适用于所有地方但在这里

- (voID)tableVIEw:(UItableVIEw *)atableVIEw dIDSelectRowAtIndexPath:(NSIndexPath *)indexPath{ MyVIEwController* clIEnte = [[MyVIEwController alloc] initWithModeAndClIEntID:2 c:cID];            clIEnte.delegate                    = self;            UINavigationController *n = [[UINavigationController alloc] initWithRootVIEwController:clIEnte];            n.navigationbarHIDden     = NO;            [[n navigationbar] setbarStyle:UIbarStyleBlack];            [self presentVIEwController:n animated:YES completion:nil];}

如果我点击该行点击,MyVIEwController会在几秒钟后显示!
如果我点击两次,它会迅速显示!
在Profiler中,单击即可发生任何事情……
我没有dIDdeselectRowAtIndexPath方法.

解决方法 解决方案是在主线程上加载第二个控制器

dispatch_async(dispatch_get_main_queue(),^{        // Code here  });
总结

以上是内存溢出为你收集整理的ios – 单击时未调用UITableView didSelectRowatIndexPath全部内容,希望文章能够帮你解决ios – 单击时未调用UITableView didSelectRowatIndexPath所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1078710.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存