iOS CALayerInvalidGeometry

前端 未结 1 1602
执念已碎
执念已碎 2021-01-16 06:07

I have an app that is crashing, with this message:

Terminating app due to uncaught exception \'CALayerInvalidGeometry\', reason: \'CALayer position

相关标签:
1条回答
  • 2021-01-16 06:26

    The problem is between these functions:

    8   UIKit        -[UILabel setFrame:] + 233
    9   Infectious   -[SusceptibilityHistoryController buildHistogram:] + 9648
    

    You are calling label.frame = ..., and probably calculating the value somehow and the result is a NaN, which means "not a number" and, as you correctly suggested, it can be the result of o divide-by-zero operation. But it can appear for a lot other reasons: http://en.wikipedia.org/wiki/NaN

    Go through the function called "buildHistogram:", find the call to either "setFrame" or ".frame = " and find how can the computed position become NaN. If there is a division involved, it will probably be a division by zero.

    0 讨论(0)
提交回复
热议问题