How to detect where NaN is passing to CoreGraphics API on Mac OS X 10.9

前端 未结 5 577
一个人的身影
一个人的身影 2021-01-31 08:04

I have very large graphic Mac app and now I receive a lot of the following messages in Console on 10.9 GM.

: Error: this application, or a library i         


        
5条回答
  •  无人及你
    2021-01-31 08:26

    The habit of creating lazy UIView's with a .zero frame played against me when doing it for a PDFView.

    This

    var pdfView = PDFView(frame: .zero)
    

    will generate lots of the same logs from the question. The reason I used .zero, is because later I set up the view with constraints. This proved to be a problem. The solution was to use an arbitrary, non-zero frame when initializing the PDFView.

    var pdfView = PDFView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
    

    Now the issue is gone.

提交回复
热议问题