データ (Google、Yahoo、Facebook) を に読み込みます。 UITableView
(Google) をクリックすると、 を使用して Gmail ページにリダイレクトされますUIWebView
。
何を書くdidSelectRowAtIndexPath
?
データ (Google、Yahoo、Facebook) を に読み込みます。 UITableView
(Google) をクリックすると、 を使用して Gmail ページにリダイレクトされますUIWebView
。
何を書くdidSelectRowAtIndexPath
?
WebView を含むビュー コントローラーを作成し、TableViewController でこのコードをdidSelectRowAtIndexPath
Method に追加します。
- (void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
WebViewController *WebViewController = [[TrackViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
//And do here code for passing URL to WebViewController
[self presentModalViewController:webViewController animated:NO];
}
また、ナビゲーションコントローラーを使用している場合
- (void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
WebViewController *WebViewController = [[TrackViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
//And do here code for passing URL to WebViewController
[self.navigationController pushViewController:aTrackViewController animated:NO];
}
navigaion コントローラーを使用し、didSelectRowAtIndexpath メソッドで特定の URL を使用して Web ビューをロードし、テーブルから選択した URL を取得して渡します。