CAL9erInvalidGeometry在iOS9“具有非有限位置[inf inf]”的子层上崩溃 [英] CALayerInvalidGeometry crash on iOS9 "sublayer with non-finite position [inf inf]"

查看:375
本文介绍了CAL9erInvalidGeometry在iOS9“具有非有限位置[inf inf]”的子层上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS 9,Swift 2:我有一个自定义视图的视图控制器,每当我从它的导航控制器堆栈中弹出它时都会崩溃,引用下面的崩溃:

iOS 9, Swift 2: I've got a view controller with a custom view that crashes whenever I pop it from it's navigation controller stack, citing the following crash:

 *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'sublayer with non-finite position [inf inf]'

在视图控制器中发布的内容太多了(这是我正在清理的中间)但是想知道是否有人经历过类似的问题?

There is far too much going on in the view controller to post here (it's what i'm in the middle of cleaning up) but was wondering if anyone has experienced a similar issue?

我见过具有非有限位置[inf inf]的子层和相关问题,但都没有解决问题。在整个代码库中找不到CGRectNull,所以我有点难过。

I've seen sublayer with non-finite position [inf inf] and a related question, but neither resolve the problem. There is no CGRectNull to be found in the entire code base, so i'm a bit stumped.

推荐答案

当然,我在挣扎30分钟后发布问题,我终于破解了它。

And of course as soon as I post the question after 30 minutes of struggling, I finally crack it.

在视图的其他地方有一大堆子视图被添加到视图中我不知道的控制器。主视图使用基于约束的布局,而这些子视图是使用框架创建的,然后添加为子视图。

There were a whole bunch of subViews that were being added to the view elsewhere in the view controller that I wasn't aware of. The main view is using constraints based layout while these subviews were being created with a frame and then added as a subview.

我不确定它为什么会导致崩溃,但删除所有流氓子视图后一切都很顺利。

I'm not sure why it was causing a crash, but after removing all the rogue subviews all was well.

如果其他人遇到同样的问题,我会保留此问题/答案。

I'll keep this question/answer alive in case anyone else has the same issue.

这篇关于CAL9erInvalidGeometry在iOS9“具有非有限位置[inf inf]”的子层上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆