OSX: Three Finger Tap crashes our application because of unimplemented characterIndexForPoint method


#1

Our application crashes whenever a three finger tap is performed. An exception is raised because characterIndexForPoint is called but not implemented.
The JUCEDemo throws this exception as well.
To test this enable the ‘Tap with three fingers’ in the Trackpad settings of your Mac.
Start the JUCE demo, perform a ‘Three finger Tap’, check the console and see that it spits out the unhandled exception.
Looking through the code i found that a static characterIndexForPoint is defined in NSViewComponentPeer but not assigned like for instance the validAttributesForMarkedText is. Which is odd because why else would this method be declared in the first place.
When i add this line the exception dissapears, do you guys think this is a safe fix?
addMethod (@selector (characterIndexForPoint), characterIndexForPoint, "@@:");


#2

Thanks for reporting this. I have pushed the fix to develop, it should appear shortly.


#3

thanx.