Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning convertPointToBase is deprecated

In my OS X application, I am getting a warning(below) in the console when my web view loads certain webpages, but all webpages do not generate this warning on load, which seems strange to me, as it seems like the contents of the web view should have no bearing on what methods are called.

I do not explicitly call this method in my code.

WARNING: Method convertPointToBase: in class NSView is deprecated on 10.7 and later. It should not be used in new applications. 

So at some point the NSView method convertPointToBase is being called, but what could cause this to be called if I do not call it explicitly in my code.? Could auto layout be calling this method...?

like image 554
Gary Simpson Avatar asked Jan 24 '15 11:01

Gary Simpson


1 Answers

I made a copy of the app and began stripping it back to basics, in order to determine where this issue was arising.

I tracked the issue to my asking for a layer on the main view that comes with the window for free. I think that means my web view then exists inside a layer backed view.

masterView.wantsLayer = true
masterView.layer?.backgroundColor = CGColorCreateGenericRGB(0.72, 0.73, 0.74, 1)

When I remove these 2 lines the issue is no longer present and no webpage generates this warning when loaded.

like image 185
Gary Simpson Avatar answered Oct 15 '22 13:10

Gary Simpson