사용자가 셀을 클릭하면 다른 viewController가 열리 며 응용 프로그램을 가지고 있으며 내 tableview에 uisearchcontroller
을 추가하기 만하면됩니다.didSelectRowAtIndexPath uisearchcontroller가있는 인덱스 경로
테이블 뷰에서 검색 할 때 결과는 정확하고 이지만 필터링 후 셀을 클릭하면 잘못된 페이지가 열립니다.
내 문제는 내가 uiviewcontroller
이 결과를 열고 올바른 페이지
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
IndexPathRow = indexPath.row
performSegueWithIdentifier("toView2", sender: self)
}
을 만들기 위해 편집
활성화 나는 새로운 추가하여 내 문제를 해결할 때 indexpath
을 식별하는 방법을 지금하지 않는 것입니다 변수를 정수형 구조체에 넣은 다음 didSelectRowAtIndexPath 함수를
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if resultSearchController.active && resultSearchController.searchBar.text != ""{
IndexPathRow = filteredData[indexPath.row].i
}
else {
IndexPathRow = indexPath.row
}
performSegueWithIdentifier("toView2", sender: self)
}
더 많은 정보를 제공해야합니다. 다양한 셀 (셀 정보 배열과 같은)에 무엇이 저장되어 있는지 일종의 메소드가 있어야합니다. 그런 다음 행은 배열의 해당 지점에있는 요소에 해당 할 수 있습니다. – Kendel