初心者の質問。はい、いろいろ調べましたが、この特定のインスタンスに対して何をすべきかについての適切な説明が見つかりませんでした。これは非常に単純だと思いますが、問題があります。5 分間コードを見て、私の理解を助けることができれば、それは素晴らしいことです。
わかりました。'MyCell' という識別子を付けた •cell というカスタム セルがあります。これは詳細で満たされ、うまく機能します。問題は、これを詳細ビューに渡そうとしたときです。これを渡す最良の方法、特にカスタムセルの一部からテキストを取得し、これをdetailViewで複製する方法を理解するのに苦労しています-カスタムセルでそれと同じように呼び出されることを意図したテキストラベルですはdetailViewか何か他のものですか?didSelectRowAtIndexPath に何かを追加する必要があることはわかっていますが、これを作成する方法がわかりません。
私のdetailViewControllerはdetailViewControllerと呼ばれ、識別子でアイデンティティdetailViewControllerが与えられます
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// I've called this •cell but my custom cell is called MyCell in the identifier - I'm not sure if this makes a difference?
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
//then I craete my detailViewController
UIViewController *detailViewController = [[UIViewController alloc] initWithNibName:@"detailViewController" bundle:nil]; // ...
//I think I understand this bit - detailTitle is the name I have given to the text label in the detail view and venueHeader is the name of the corresponding label in the custom cell - I want the detailTitle to = venueHeader
detailViewController.detailTitle = CustomCell.venueHeader.text;
// I have created a segue in storyboards so I don't know if I need this bit of code as well?
[self.navigationController pushViewController:detailViewController animated:YES];
}