2017-09-21 1 views
-1

とクラッシュ、私のアプリがクラッシュします。どうして?iOSの11:私は、スクロールビューが含まれているのViewControllerを押しiOSの11では、UIScrollViewを

コードプッシュする:

let programViewController = self.storyboard?.instantiateViewController(withIdentifier: "ProgramViewController") as? ProgramViewController 
self.navigationController?.pushViewController(programViewController!, animated: true) 

エラー:

-[UIView adjustedContentInset]: unrecognized selector sent to instance 0x7fca395ed440 2017-09-21 21:01:53.203465+0200 ApplicationName[1980:45337] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView adjustedContentInset]: unrecognized selector sent to instance 0x7fca395ed440'

はコード:確かに

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 
    let cell = tableView.cellForRow(at: indexPath) 
    switch self.typeContent { 
    case "news" : 
     let listNews = self.listObjects as! [NewsArticle] 
     let webViewController = self.storyboard?.instantiateViewController(withIdentifier: "WebViewController") as? WebViewController 
     webViewController!.url = listNews[(indexPath as NSIndexPath).section].link 
     self.navigationController?.pushViewController(webViewController!, animated: true) 
    case "program": 
     let part = self.listObjects[indexPath.section] as! ProgramPart 
     let event = part.listEvents[indexPath.row] 
     let programViewController = self.storyboard?.instantiateViewController(withIdentifier: "ProgramViewController") as? ProgramViewController 
     programViewController?.paramsList = ["event_id": "\(event.id)"] 
     programViewController?.delegate = cell as? FollowEventDelegate 
     self.navigationController?.pushViewController(programViewController!, animated: true) 
    default : 
     break; 
    } 
} 
+0

? – Donal

+0

いいえ、tableViewCellを選択したとき。 – MichelRobico

+0

あなたはdidSetRowAtのインデックスメソッドで書かれています。コードを共有してください。 – Donal

答えて

0

は、私UIScrollViewの内側に、私はUIViewの他のすべてが含まれていUIViewのを持っていました。だから、私はすべてのUIViewをUIScrollViewに直接入れるためにそれを削除し、私は制約を処理するためにもっと先を割いています。 Rmaddyが質問に私を連れてきてくれてありがとう。ボタンアクションで書かれたプッシュアクション上記

関連する問題