我在tableView的didselect代理中選擇了當(dāng)前行,然后創(chuàng)建一個(gè)新視圖控制器,并彈出
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ShowImageController *showVC = [ShowImageController new];
[self presentViewController:showVC animated:YES completion:nil];
}
然而,新視圖并不會(huì)被彈出!
上網(wǎng)查了查發(fā)現(xiàn),可能是執(zhí)行的的線程問題,加上主線程執(zhí)行即可!
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
dispatch_async(dispatch_get_main_queue(), ^{
ShowImageController *showVC = [ShowImageController new];
[self presentViewController:showVC animated:YES completion:nil];
});
}
完美解決問題perfect.如果有其他的問題.持續(xù)更新謝謝
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者