gpt4 book ai didi

ios - 将 TableView Controller 中的单元格链接到网页

转载 作者:行者123 更新时间:2023-11-29 03:50:42 25 4
gpt4 key购买 nike

我有一个带有多个单元格的 TableView Controller 。如何将单元格链接到网页?我正在考虑将它们链接到另一个具有 Web View 的 View Controller ,但这需要很长时间,因为我有很多单元格要链接。如何将单元格链接到网页?

最佳答案

在你的 didSelectRow 方法中

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath   
{
NSString * urlString = [self.yourArrayWithLinks objectAtIndex:indexPath.row];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];

}

关于ios - 将 TableView Controller 中的单元格链接到网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17114736/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com