とクラッシュ、私のアプリがクラッシュします。どうして?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;
}
}
? – Donal
いいえ、tableViewCellを選択したとき。 – MichelRobico
あなたはdidSetRowAtのインデックスメソッドで書かれています。コードを共有してください。 – Donal