2013-12-18 40 views
0

我有一個UITableView,我想在那裏鏈接到蘋果網站,當用戶點擊UITableView中的第一個單元格或行。這是我的代碼:不能做一個表視圖單元格操作

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

    } 

} 

回答

0

首先,獲取目標C的一些基本檢查這些拿到UITableView代表&數據源的方法UITableView Delegate & UITableView DataSource methods知識。

對於你的問題,你必須使用這個方法: -

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

在這種方法中,檢查所選行,並相應地編寫代碼。您可以在UIWebView或Safari中打開鏈接。

相關問題