컨트롤러가 3 개 있습니다. 첫 번째 CollectionViewController, 다음 TableViewController 및 마지막 CollectionViewController. 첫 번째와 두 번째 컨트롤러는 json을 완벽하게 통과했습니다. 하지만 tableViewController didSelect가 작동하지 않습니다.스위프트 : TableViewController didSelectRowAt Index_path 함수가 작동하지 않습니다.
첫 collectionViewController
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let controller1 = ListTableView()
controller1.product_id = arrCategory[indexPath.item].id!
navigationController?.pushViewController(controller1, animated: true)
}
아마 문제가
재정의 FUNC의있는 tableView 코드를 여기에 두 번째 tableViewController (_있는 tableView : jQuery과, didSelectRowAt indexPath : IndexPath) {
let 레이아웃 = UICollectionVi ewFlowLayout()
let controller1 = DescriptionCollectionView(collectionViewLayout: layout)
controller1.product_id = arrProduct[indexPath.item].id!
navigationController?.pushViewController(controller1, animated: true)
}
JSON 웹 코드 내가 예를 아래에, 당신은 분명히 코드 prepareForSegue
를 사용하는 것이 좋습니다 3 더 collectionViewController
segue가 프로그래밍 방식으로 신속하게 작동하지 않습니다. 여기서 모든 코드를 프로그래밍하고 있습니다. –
프로그래밍 방식을 사용하고 있습니까? –
프로그래밍 방식으로 세그먼트에 단절이 있습니다. –