I'm adding sharing to my app (targeting Mavericks, 10.9), which I want to work like this:
I'm accomplishing this using the -mouseDown:
, -mouseDragged:
, and -mouseUp:
events. mouseDown
begins the selection, mouseDragged
provides feedback as to the area being selected, and then mouseUp
completes the drag, showing the picker. Each time, though, I get this written to the console:
2014-06-25 00:13:45.111 App[31401:303] Warning: -[NSSharingServicePicker showRelativeToRect: ofView: preferredEdge:] should not be called on mouseUp
Please configure the sender with -[NSControl sendActionOn:NSLeftMouseDownMask];
I don't understand why that would be a problem, unless you were showing it from a button click on mouse up. Should I ignore the message? I've tried showing it using dispatch_async
and dispatch_after
to try and get it to run outside the event's invocation, but they didn't work. I suppose I could ignore it, but does that leave the door to deprecation open?
I know this is a year late but,
I had the same problem. After some research, I cam back with this answer. Before I implemented this code, my button would spin for a while, and then return with the same error you had. When I click my share button now, it no longer lags, and does not return any error. Insert this into your app's awakeFromNib
method:[yourShareButtonName sendActionOn:NSLeftMouseDownMask];
.
This is what your code should look like:
- (void)awakeFromNib {
[yourShareButtonName sendActionOn:NSLeftMouseDownMask];
}
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With