'NSEvent' may not respond to '+modifierFlags'


#1

I get these warnings when compiling a project, fwiw:

modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:962: warning: 'NSEvent' may not respond to '+modifierFlags' modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:962: warning: (Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.)

This is in ModifierKeys::getCurrentModifiersRealtime().


#2

Yes, but If you look at the code, you’ll see that it checks whether the selector is available before calling it, so it’s quite safe. And you’ll only get the warning if you’re compiling with an older SDK anyway.


#3

Yes, I realize it will check. I just wonder why it shows the warning for this when it doesn’t for other calls.

Why does it only happen with an older sdk?


#4

Because they only added the API call in a more recent SDK.


#5

Ok, good to know.