在iOS 11中,当我按下包含滚动视图的ViewController时,我的应用程序就会崩溃。为什么?
推送代码:
let programViewController = self.storyboard?.instantiateViewController(withIdentifier: "ProgramViewController") as? ProgramViewController
self.navigationController?.pushViewController(programViewController!, animated: true)
错误:
-UIView adjustedContentInset:未识别的选择器发送给实例0x7fca395ed440 2017-09-21 21:01:53.203465+0200 ApplicationName1980:45337 *终止应用程序由于未识别异常'NSInvalidArgumentException',原因:'-UIView adjustedContentInset:未识别的选择器发送到实例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;
}
}
发布于 2017-09-21 22:02:01
实际上,在我的UIScrollView中,我有一个包含所有其他UIView的UIView。因此,我删除了它,将所有的UIView直接放到UIScrollView中,并且我提前告别了更多来处理约束。谢谢你带我来问这个问题。
https://stackoverflow.com/questions/46351556
复制相似问题