Warning convertPointToBase is deprecated
Asked Answered
F

1

6

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...?

Festivity answered 24/1, 2015 at 11:5 Comment(5)
Good question - quite strange!Allpowerful
It's being called from a library function. What external libraries are you using?Indian
I have not added any external library's. The only thing that is called from my code to generate the warning is, in the controlTextDidEndEditing delegate method, when I hit return in my url field, I have :mainWebview.takeStringURLFrom(urlTextField) ..... Nothing else in my code executes, yet when most but not all webpages load I see the warning. There are some pages that never generate this warning. Really weird.Festivity
Perhaps Apple did just not replace the deprecated method in UIWebView or WebKit yet. Then you the only thing you can do is to file a bug report.Hamachi
I hope, the warning I see is a bug in WebKit, but I made a test app with a simple browser, and I do not see the error there. That said, it could still be something to do with the way I have the WebView constrained in the problematic application, that may be causing WebKit to call the depreciated method.Festivity
F
3

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.

Festivity answered 24/1, 2015 at 16:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.