Cocoa bindings is Apple’s implementation of the Model-View-Controller design pattern for Mac OS X applications. It provides technologies that automate the synchronisation of domain data and the user interface elements that present them.
Questions tagged [cocoa-bindings]
975 questions
4
votes
1 answer
Need some tips regarding the Cocoa MVC/KVO patterns
This is a very wide-ranging/vague question, but here goes. Apologies in advance.
The app (desktop app) I'm building takes different kinds of input to generate a QR code (I'm just building it to learn some Obj-C/Cocoa). The user can switch between…

Flambino
- 18,507
- 2
- 39
- 58
4
votes
1 answer
Programmatically binding NSTreeController to NSOutlineView
To support a different language than Swift and ObjC, I need to understand how to set up an NSTreeController for an NSOutlineView.
I have already been able to create the NSOutlineView in code, along with providing my own DataSource delegate. But now…

Thomas Tempelmann
- 11,045
- 8
- 74
- 149
4
votes
1 answer
Should I use Cocoa Bindings in Swift?
I am not too sure about the fundamental difference between Cocoa Bindings and IBOutlets/IBActions. I am currently migrating an Obj-C project to Swift 3 and I want to know whether it is common practice to use bindings, especially in Swift? There is…

Madhav Sharma
- 103
- 5
4
votes
2 answers
Does Cocoa connection binding to NSToolbarItem prevent deinitializing?
Trying to set the selected segment of an NSToolbarItem that's an NSSegmentedControl via connection binding to a property (optionSegment). Subclassing the window controller as such
class MyWindow: NSWindowController {
dynamic var optionSegment:…

JKaz
- 765
- 6
- 18
4
votes
2 answers
Is it possible to use bindings in the nib with ScreenSaverDefaults?
I'm working on a screensaver, so I'm supposed to use ScreenSaverDefaults instead of NSUserDefaults. I'd like to have my configure panel use bindings for its UI, but they need to be wired to ScreenSaverDefaults, and I can't see a way to do that; the…

bhaller
- 1,803
- 15
- 24
4
votes
1 answer
How to bind a control to a singleton in Cocoa?
I have a singleton in my FTP app designed to store all of the types of servers that the app can handle, such as FTP or Amazon S3. These types are plugins which are located in the app bundle. Their path is located by applicationWillFinishLoading: and…

vilhalmer
- 1,149
- 3
- 11
- 23
4
votes
1 answer
Clean bindings with structs
I have a model class for which it makes quite a lot of sense to have NSSize and NSPoint instance variables. This is lovely.
I'm trying to create an editing interface for this object. I'd like to bind to size.width and whatnot. This, of course,…

andyvn22
- 14,696
- 1
- 52
- 74
4
votes
1 answer
Binding Null Placeholder not translated in view based NSTableView
I have a view based NSTableView whose content is bound to an array controller. I bind one specific text field using objectValue.title. This works fine. I also have set a null placeholder for that binding which is indeed displayed when the value is…

Sbhklr
- 2,693
- 1
- 17
- 20
4
votes
3 answers
Exposing model object using bindings in custom NSCell of NSTableView
I am struggling trying to perform what I would think would be a relatively common task. I have an NSTableView that is bound to it's array via an NSArrayController. The array controller has it's content set to an NSMutableArray that contains one or…

Hooligancat
- 3,588
- 1
- 37
- 55
4
votes
0 answers
Dealing with out-of-model menu items in NSPopUpButton
It is trivial to setup NSPopUpButton's menu via binding with an NSArrayController. A slightly more complicated, but very frequent use case, is to use NSContentPlacementTagBindingOption to insert the array items into the menu from a specified index.…

Daniel Farrell
- 9,316
- 8
- 39
- 62
4
votes
1 answer
How can I determine if Apple methods are asynchronous?
I'm binding an NSArrayController to a managedObjectContext with mainQueueConcurrency.
All that I want is to do is modify the sort properties the arrangedObjects with my own function and then call rearrangeObjects and then select some objects.
But…

stevesliva
- 5,351
- 1
- 16
- 39
4
votes
2 answers
How to bind an editable TextField to a read-only property
Does anyone know how to prevent Cocoa binding to set values back to the bound property but still fires the default action selector?
I am trying to bind a NSTextField to a readonly NSString property on my data object.
My data Object is…

Jonny
- 312
- 4
- 14
4
votes
1 answer
Validating input in NSOpenPanel accessory view
I would like to solicit additional information from the user during the NSOpenPanel but need to validate that information before the open panel completes. For example, I may want to allow the user to add a note about the file in the open panel…

Barry Wark
- 107,306
- 24
- 181
- 206
4
votes
1 answer
How does NSTableView modify the selection of NSArrayController via bindings?
Let's say I have the following situation:
When I select different rows in the NSTableView, it magically updates the NSArrayController (PersonController) selection. How is the NSTableView doing this? Does it do something like this:
-…

Tom Dalling
- 23,305
- 6
- 62
- 80
4
votes
2 answers
NSManagedObjectContext and NSArrayController reset/refresh problem
I'm having trouble getting my UI to reflect external changes (made by another process) to an sqlite data store.
I have a fairly standard core data based NSArrayController / table view. My app gets notified that external changes have been made to the…

Adrian
- 1,066
- 1
- 13
- 20