- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在将 Xcode 更新到 8.3 后,我在启动时开始收到此错误:由于未捕获的异常“CALayerInvalidGeometry”而终止应用程序,原因:“CALayer 位置包含 NaN:[nan nan]”
我的应用程序的主视图有几个容器 View ,其中一个包含一个 mapView。看来错误与 map 有关,但我无法从消息中完全弄清楚那可能是什么。任何想法将不胜感激!
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
*** First throw call stack:
(
0 CoreFoundation 0x00000001029b1b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000102416141 objc_exception_throw + 48
2 CoreFoundation 0x0000000102a1a625 +[NSException raise:format:] + 197
3 QuartzCore 0x00000001039d90be _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152
4 QuartzCore 0x00000001039d9231 -[CALayer setPosition:] + 43
5 MapKit 0x000000010354a97b -[MKMapView _updateScrollContainerView:] + 1214
6 MapKit 0x000000010354bbeb -[MKMapView _sizeDidChangeWithCenterCoordinate:] + 55
7 MapKit 0x000000010354606e -[MKMapView setBounds:] + 271
8 UIKit 0x0000000103c14b23 -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 598
9 UIKit 0x0000000103c14e0e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 125
10 CoreFoundation 0x0000000102942652 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
11 CoreFoundation 0x000000010294256f -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 335
12 UIKit 0x0000000103c1387c -[UIView(Geometry) resizeSubviewsWithOldSize:] + 183
13 UIKit 0x000000010452f1f9 -[UIView(AdditionalLayoutSupport) _is_layout] + 168
14 UIKit 0x0000000103c1fd56 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 994
15 UIKit 0x0000000103c3120b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268
16 QuartzCore 0x00000001039e2904 -[CALayer layoutSublayers] + 146
17 QuartzCore 0x00000001039d6526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370
18 QuartzCore 0x00000001039d63a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
19 QuartzCore 0x0000000103965e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x0000000103992130 _ZN2CA11Transaction6commitEv + 468
21 QuartzCore 0x0000000103992b37 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 115
22 CoreFoundation 0x0000000102957717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
23 CoreFoundation 0x0000000102957687 __CFRunLoopDoObservers + 391
24 CoreFoundation 0x000000010293c038 CFRunLoopRunSpecific + 440
25 UIKit 0x0000000103b6802f -[UIApplication _run] + 468
26 UIKit 0x0000000103b6e0d4 UIApplicationMain + 159
27 Pulley 0x0000000101bd95b7 main + 55
28 libdyld.dylib 0x0000000109eaa65d start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
最佳答案
您似乎正在使用 CALayer
对象执行 setPosition:
并且 CALayer 对象为 nil。这就是您的应用崩溃的原因。
请通过if
语句检查CALayer
是否为nil
。
关于ios - 调试 'CALayer position contains NaN: [nan nan]',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43086753/
如果我将 cornerRadius 属性设置为我想要 mask 的图层,我只能设法做到这一点。 我正在努力实现: 整个蓝色的 UIView。 全背景为红色的 CALayer。 maskLayer,比第
我正在尝试用另一层 (stickerMask) 的图像遮盖一个 CALayer(newSticker),如下所示: func placeSticker(location: CGPoint) {
我有一个 UIBezierPaths 数组,我正在循环创建一个 CALayer。生成 CALayer 的代码如下所示: let layer = CAShapeLayer() layer.path =
我正在尝试使用 CALayers 制作一个 donut 形状。一个 CALayer 将是一个大圆圈,另一个将是一个位于其中心的小圆圈,将其遮盖。 大圆圈显示正常,但每当我调用 circle.mask
我有以下代码: CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CALayer
我有一系列随机放置在屏幕上的图层。添加每一层时,它都位于所有其他层之上。 最终,一个层被其他层完全覆盖。此时,我想从内存中删除图层。 有什么方法可以知道一个层何时被其他层覆盖(100% 或部分)? 每
我正在尝试子类化 CALayer 以用作另一层上的 mask 。 我想使用我的 CALayer 子类代替 CAGradientLayer 并将其用于渐变蒙版,如 here 所述. 不过,我希望使用自定
在 XCode 中创建一个简单的项目 设置 View 以接收多点触控事件 在touchesBegan中响应,检测到触摸事件时创建CALayer 为 CALayer 制作不透明度淡出动画 当动画停止时,
我找不到这个问题的答案。 我想知道如何使 calayer 中的图像大小小于 calayer 的边界大小。 我在 iPad 游戏中有几个 pawn,每个都是一个 CALayer,我让它们通过 conte
我正在使用 Cocoa 为 Mac 编写游戏。我目前正在实现 HitTest ,并发现 CALayer 提供 HitTest ,但似乎没有实现 alpha 属性。由于我有时会将许多 CALayer 堆
我们正在尝试创建一个自定义的 CIFilter 以添加到我们的 CALayer 的顶部。 如何只有默认的 CIFilter 似乎可以在 CALayer 上工作。 我们在添加的 ViewControll
我们正在尝试创建一个自定义的 CIFilter 以添加到我们的 CALayer 的顶部。 如何只有默认的 CIFilter 似乎可以在 CALayer 上工作。 我们在添加的 ViewControll
我有很多 UIImage 实例。我将在 TableView 情况下的 View 之间移动它们。我有两个选择: 每个 UIImage 有一个 CALayer,将 CALayer 移动到不同的 View
我想按时间顺序依次添加多个 CALayer。我可以使用此链接向视频文件添加一层 Here .现在我的问题是如何将多个 CALayer 添加到视频文件。 提前致谢.. 最佳答案 最直接的方法是将多个层捆
我正在尝试实现一个具有隐式动画属性的图层,但我看到了一些非常奇怪的行为。这是一个简单的层,它演示了我的意思: class CustomLayer: CALayer { override ini
我正在尝试构建一个动画圆,该圆将顺时针绘制,直到它变成完整的圆,如 iPhone Core Animation - Drawing a Circle 所示。 问题是CALayer对象未添加或构建。我测
我有一个 CALayer在 AVMutableComposition淡入,应该在屏幕上停留一段时间然后消失。问题是,它应该在没有动画的情况下消失,但是 CABasicAnimation最短持续时间为
是否可以在 iPhone 上对 CALayer 的边界进行动画处理?如何实现?谢谢! 最佳答案 是的,这是可能的。 [UIView beginAnimations:nil context:NULL];
调查后Custom UITableViewCell backgroundView & selectedBackgroundView ,我注意到每层 backgroundView 和 selectedB
我目前正在尝试使用基于 CALayers 的核心动画制作 2D 游戏。我已经弄清楚了用户 Sprite 层,但现在它归结为游戏对象。 物体(用户必须避开)将从屏幕顶部掉落,如果它们从未与用户接触就会消
我是一名优秀的程序员,十分优秀!