Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のView Controllerに何かを渡すために、prepareForSegueをよく使用しました。私のテーブルビューがセクションを使用していない場合は問題ありません。しかし、最新のプロジェクトにセクションを追加しました。セクション参照を含む indexpath を受信しないため、今は prepareForSegue の使用方法がわかりません。私は何が欠けていますか?助けてくれてありがとう!
prepareForSegue メソッドでは、次を使用します。
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
それをdestinationViewControllerに渡します。