首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >iOS 11 : UIScrollView崩溃

iOS 11 : UIScrollView崩溃
EN

Stack Overflow用户
提问于 2017-09-21 19:12:43
回答 1查看 993关注 0票数 0

在iOS 11中,当我按下包含滚动视图的ViewController时,我的应用程序就会崩溃。为什么?

推送代码:

代码语言:javascript
运行
复制
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‘

代码:

代码语言:javascript
运行
复制
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;
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-21 22:02:01

实际上,在我的UIScrollView中,我有一个包含所有其他UIView的UIView。因此,我删除了它,将所有的UIView直接放到UIScrollView中,并且我提前告别了更多来处理约束。谢谢你带我来问这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46351556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档