简体   繁体   English

在didSelectRowAtIndexPath iPhone SDK中打开电话链接

[英]Opening Phone Links in didSelectRowAtIndexPath iPhone SDK

Is it possible to determine a row's detailTextLabel based on an indexPath in didSelectRowAtIndexPath ? 是否可以基于didSelectRowAtIndexPathdetailTextLabel确定行的detailTextLabel

I want to be able to open a phone link using 我希望能够使用打开电话链接

[[UIApplication sharedApplication] openURL:xyz] 

if the cell has the detail text label "phone". 如果该单元格具有详细文本标签“ phone”。

Is this possible? 这可能吗?

Thanks 谢谢

[[myTableView cellForRowAtIndexPath:path].detailTextLabel.text isEqualToString:@"phone"];

Assuming that you provide the data source for the table view, you could check your data directly instead of the table view cell. 假设您为表格视图提供了数据源,则可以直接检查数据而不是表格视图单元格。

If this is somehow not possible, you could always call yourself: 如果以某种方式无法实现,则可以随时打电话给自己:

[[tableView dataSource] tableView:tableView cellForRowAtIndexPath:indexPath]; and inspect the resulting cell. 并检查生成的单元格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM