didSeletedRowAtIndexPath方法調(diào)用UIAlertController會卡頓,求解!
閉關(guān)修行中......
有很多人遇到過類似的問題, 好像是個 bug, 你試試切換到主線程來顯示 UIAlertController:
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alertController animated:YES completion:nil];
});
按理來說不應(yīng)該是這樣的, 因為 didSelectRowAtIndexPath 應(yīng)該也是在主線程執(zhí)行的。
didSeletedRowAtIndexPath 估計這個方法是異步執(zhí)行的,曾經(jīng)使用 [tableView selectRowAtIndexPath: animated: scrollPosition:]
崩掉了,但是使用 [Controller tableView: didSelectRowAtIndexPath:]
不崩。在cell的數(shù)據(jù)源方法里調(diào)用的,但是打印出的信息來看,didSelectRowAtIndexPath: 是等數(shù)據(jù)源方法全部執(zhí)行完之后才調(diào)用。
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號