简体   繁体   中英

Opening Phone Links in didSelectRowAtIndexPath iPhone SDK

Is it possible to determine a row's detailTextLabel based on an indexPath in didSelectRowAtIndexPath ?

I want to be able to open a phone link using

[[UIApplication sharedApplication] openURL:xyz] 

if the cell has the detail text label "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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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