0

I have a UITableView and I want there to link to the Apple website when the user taps the first cell or row in the UITableView. This is my code:

- (void)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath {
if (indexPath == 0) {

     }

}
Loukas
  • 616
  • 1
  • 6
  • 22
MicahKE
  • 125
  • 1
  • 1
  • 7

1 Answers1

0

First of all, get some basics of Objective C. Check these to get the knowledge of UITableView delegate & datasource methods UITableView Delegate & UITableView DataSource methods.

For your question, you have to use this method:-

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
}

In this method, check for selected row and write your code accordingly. You can open link in UIWebView or Safari.

Piyush Dubey
  • 2,416
  • 1
  • 24
  • 39