107 questions
0
votes
2
answers
61
views
Invisibly block user interaction in macOS app
In my macOS app (objC), the user can trigger tasks that can take some time, like importing files into a database. These tasks do not run on the main thread because they spawn a window (sheet) to show ...
0
votes
0
answers
124
views
Disable that AVPlayerView stops video when pressing the pause ⏯️ key
Currently I am using an AVPlayerView in combination with an AVPlayer in my Cocoa App.
The video plays fine but I want to disable that the AVPlayerView or AVPlayer responds to key presses that for ...
1
vote
1
answer
272
views
WKWebView in Cocoa app can't get the cursor on click
I created a simple test app where one field is an NSTextField and another is a <textarea> instead a WKWebView. I can click into the web view once, but if I go back to the NSTextField, I'm unable ...
1
vote
2
answers
741
views
NSApplication responder chain for arrow keys
I have an NSTextField in my window and 4 menu items with key equivalents ←↑→↓.
When the text field is selected and I press an arrow key, I would expect the cursor to move in the text field but ...
1
vote
0
answers
557
views
How to manage the velocity with my PanResponder?
I'm trying to use the PanGestureHandler api from the react-native-gesture-handler package and especially the move with velocity.
Everything is working well with the panGesture, the properties ...
0
votes
1
answer
432
views
Direction that NSView received focus (tab or backtab)?
I have a custom view that has multiple components that can receive the focus, similar to NSDatePicker in the textFieldAndStepper style. If it gets the focus the first component is focused. You can ...
1
vote
0
answers
113
views
supplementalTargetForAction:sender: doesn't get called
I am trying to send an action from a menu item to a child view controller of a NSSplitViewController. As I understand I am supposed to override supplementalTargetForAction:sender: on the ...
0
votes
2
answers
314
views
How to tab to a Cocoa text editing field that is scrolled out of view
I've got a window with a single text editing field next to a scrolling view. The document view of the scrolling view contains multiple sub-views, and some of those sub-views contain text editing ...
3
votes
1
answer
834
views
Custom NSStoryboardSegue not adding NSViewController to Responder Chain
Overall goal: Use a custom storyboard segue on macOS
The issue at hand is the responder chain. According to Apple:
In addition, in macOS 10.10 and later, a view controller participates
in the ...
4
votes
1
answer
276
views
NSView/NSResponder smartMagnify:
I am trying to implement smartMagnify: in an NSView, but it is never called. I have rotate:, magnify:, etc., and they are all being called successfully - what do I need to do to receive this message? ...
8
votes
1
answer
2k
views
NSToolbarItem validation in relevant controller
I have an NSToolbarItem with an NSButton as its view and an NSMenuItem in the main menu. Both have the same action, which is sent to the first responder, not to a particular target. That method is ...
3
votes
0
answers
183
views
Non-NSView NSResponder to handle NSDocument responder actions
My NSDocument subclass (MyDocument) is quite large and I was thinking about making a MyDocumentResponder (subclass of NSResponder) to handle document responder events in order to clean up the code. ...
3
votes
1
answer
201
views
How to update NSResponder selector in swift 2.2
I am implementing a NSControlTextEditingDelegate protocol and I don't know which class/protocol i should match with e.g. commandSelector. #selector(WhichClass.moveUp(_:)) so that the equality will ...
0
votes
0
answers
53
views
NSResponder print: call going to wrong place
In my NSViewController I placed a print(_:) method, but it's not being called when I hit print. Instead, the print is being captured by the current NSTextField that I'm in. How do I force the print ...
1
vote
1
answer
175
views
nextKeyView tabbing to a NSBrowser and search view in toolbar
I have a requirement in a Mac OS X app for the user to be able to tab between the follow item in a single window,
NSSearchField within the toolbar
NSBrowser
NSCollectionView
NSCollectionView (second ...
1
vote
1
answer
98
views
When multiple NSTextViews are present in a window, the one receiving typed keys isn't necessarily the one receiving command-keys. Why?
I am having a hard time understanding the responder chain in OS X.
I have an NSTextView subclass, and I want it to respond to a command-key and do something. I've created a very simple demonstration ...
1
vote
1
answer
194
views
Catch unhandled keyboard events in Cocoa
I'm working on a Cocoa app.
I would like to catch all keyboard events that are not being handled by any responder, and report them to Google Analytics.
For this purpose, I would like to set a custom ...
5
votes
2
answers
3k
views
Responder Chain in Swift (nil target in UIButton target)
I have got a problem using the responder chain in swift.
When I setup a buttons target using a nil target like:
someButton.addTarget(nil, action:"addButtonTapped:", forControlEvents: .TouchUpInside)
...
0
votes
1
answer
65
views
Undo makeFirstResponder
I want an NSTextField that prevents empty strings so I subclassed the NSTextField and implemented this method
-(void) textDidEndEditing:(NSNotification *)aNotification
{
if([[self stringValue] ...
-2
votes
1
answer
1k
views
Code=-1016 "Request failed: unacceptable content-type: text/plain" UserInfo=0x7a2da380
AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
NSLog(@"%@",[urlOfVm class]);
NSMutableString *url = [NSMutableString stringWithString:urlOfVm];
[url ...
3
votes
1
answer
1k
views
Is it possible to override the user KeyBindings with app-specific ones on a mac?
The user specific keyBindings .dict file is found in: ~/Library/KeyBindings/
How can you (as the developer) tell AppKit to look in another directory (app specific) for another bindings file for your ...
0
votes
1
answer
203
views
NSView getting dragged events when dragging window
In my app there's the strange issue that a custom NSView receives forwarded mouseDragged events when the window is dragged around the screen, usually by its toolbar.
From the stack trace it seems ...
1
vote
0
answers
199
views
magnifyWithEvent: only called when app is activated
My NSViewController implements magnifyWithEvent:. The window is a NSPanel with NSNonactivatingPanelMask as a styleMask flag.
Because of that, opening the window and using it will not activate the ...
1
vote
0
answers
737
views
How to pass mouse events from NSView to NSViewController?
I have TabViewController, and i have Make custom NSView for it TabView which i have inherits in XIB.
Now i have successfully implemented all mouse handle events in TabView and worked.
I want the ...
1
vote
2
answers
641
views
Keyboard focus lost after inserting and editing new object, when NSArrayController „Auto Rearrange Content“ is enabled
I have a master-detail kind of application OS X 10.9 only:
An NSTableView on the left side of the window, the details as NSTextFields on the right side.
I have not set the tab order specifically, out ...