いくつかのセグメント化されたコントロール、テキスト フィールド、およびテーブル ビューを含むページがあります。ユーザーは、必要なものを書き込み/選択してから、すべての値を別のビューに渡すボタンをタップします (これらの値は検索の実行に使用されます)。これは、値を渡す関数の単純化されたバージョンです。
-(IBAction) doTheSearch {
[self dismissViewControllerAnimated:YES completion:nil];
// initialize the view who will perform the search
NewSearchController *nsc = [[NewSearchController alloc] init];
// set values from one text field and one segmented control
nsc.testString = textfield.text;
NSString *temp = [NSString stringWithFormat:@"%d",segmentedcontrol.selectedSegmentIndex];
nsc.testCode = temp;
[self.navigationController pushViewController:nsc animated:YES];
}
テキスト フィールドとセグメント化されたコントロールの値に対して行うのと同じ関数を使用して、テーブル ビューから選択されている行を取得することはできますか?