Questions tagged [cocoa-bindings]

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.

975 questions
9
votes
1 answer

NSArrayController selection not updating with NSTableView binding

This has been befuddling me for hours... I have an object (CuesDoc) with a property (NSMutableArray *cuesArray) and some other properties. The cues array holds multiple Cue objects. There is a property called (CuesDoc*) currentCuesDoc in my…
AppCrafter
  • 422
  • 1
  • 4
  • 12
9
votes
2 answers

Bind to negative of a boolean property with KVO

I am using KVO to watch a checkbox, and to enable or disable a details input area based on the checkbox's state. (I.e. if the checkbox is checked, the details area is enabled, otherwise not) Something like: [self.detailInputArea bind:@"enabled"…
Donald Burr
  • 2,281
  • 2
  • 23
  • 31
9
votes
2 answers

Programmatically adding columns (with bindings) to a view-based NSTableView?

I've got a simple app that lists some models in a NSTableView. The table is a completely standard view-based table with a couple of columns, and is populated through an NSArrayController using bindings. All of that is set up in Interface Builder,…
Flambino
  • 18,507
  • 2
  • 39
  • 58
9
votes
2 answers

bind:toObject:withKeyPath:options: is one-way binding?

I have two windows: Window A is loaded from NIB; and Window B is created programmatically. Both windows have a NStextView: the attributedString of the textview in Window A is bound to the the property text of a model using IB; while the…
Jensen
  • 1,653
  • 4
  • 26
  • 42
8
votes
2 answers

How to get notified of changes to models via an NSArrayController?

I have an NSView subclass which is bound to the arrangedObjects of an NSArrayController. When the array has an item inserted or removed the view is notified. How do I get it to be notified if a model stored in the array has an attribute changed? Do…
8
votes
3 answers

Objective-C bindings - Binding an enum to an NSPopupButton

I'm working on a project which would be ideally suit Cocoa bindings for the UI but I'm having an issue binding the value of an object property and can't find a suitable solution. The object is as follows: typedef enum tagCSQuality { kQualityBest…
JWood
  • 2,804
  • 2
  • 39
  • 64
8
votes
3 answers

NSTableView and NSOutlineView drag-and-drop

I have an NSTableView and an NSOutlineView, both with their content provided by bindings, that I'd like to have some drag-and-drop functionality: Drag rows from Table A onto a row of Outline B, where they will be copied into a data structure which…
8
votes
2 answers

Observing dependent keys across a to-many relationship

I have a Core Data entity, "bid", which has a relationship to many "items", called "itemLink". in IB, I have a text field bound to "total", and that almost works. In "bid.m" I have: - (NSDecimalNumber *)total { return [self…
8
votes
1 answer

Using NSCollectionView without bindings

Is there a way to use an NSCollectionView without bindings?
8
votes
1 answer

Binding an NSMenuItem's title breaks enabled/disabled validation

I have a menu where some of the menu items use bindings to get their title. These items are always enabled, and don't neither automatically enable/disable like they should NOR do they cause a call to validateUserInterfaceItem:. If you remove the…
Paul
  • 397
  • 1
  • 11
8
votes
2 answers

Why are my images in my NSTableView faded out?

To start, there's an NSArrayController ("Servers") whose content is an array of "server" objects. I also have an NSTableView with a column. The column is bound to Server's "arrangedObjects.status" property. I use a custom NSValueConverter to make…
Michael Bishop
  • 4,240
  • 3
  • 37
  • 41
8
votes
1 answer

Use KVO for NSTextFields that are bound together

I'm having trouble getting KVO working with text fields that are bound together in a Cocoa app. I have gotten this to work when setting strings in NSTextFields with buttons but it is not working with bindings. As always, any help from Stack Overflow…
wigging
  • 8,492
  • 12
  • 75
  • 117
8
votes
7 answers

UITableViewCell error - this class is not key value coding-compliant for the key

I'm getting the following error when I try to load a custom UITableViewCell from a xib file via UINib's instantiateWithOwner method. I've tried all of the other solutions I can find on here with no luck. The issue seems to be that when the xib file…
sam2themax
  • 1,068
  • 3
  • 10
  • 14
8
votes
3 answers

how to get NSPopUpButton selected object?

I'm having a student class: @interface student : NSObject{ NSString *name; NSDate *date; } and i have a NSMutableArray for list of students, and i bound it to a NSPopUpButton like this content : studentArray, arrangedObjects content…
7
votes
1 answer

How do I override NSError presentation when bindings is involved?

One thing I've always had trouble with in Cocoa Bindings has been error presentation, for example when the user types the wrong value into a text field with a formatter attached. Normally I would override willPresentError: somewhere in the responder…
Marc Charbonneau
  • 40,399
  • 3
  • 75
  • 82
1 2
3
64 65