我在storyboard中定义的ViewController中有一个tableview。 tableview有原型单元格。我希望当用户触摸单元格时,网址应该在iphone的外部游戏中打开。怎么实现呢? 从哪里我必须调用以下行:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:siteURL]];
答案 0 :(得分:0)
在实例设置为表视图的委托的类中:
- (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)ip
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:siteURL]];
}