cocoa-bindings

Binding to an NSDictionary's "allValues" array

Am I misunderstanding something about bindings? I bind (an NSArrayController's content) to an NSDictionary's "allValues" array, and it thinks it's empty. I bind to a random object with a property that I've set to be that same NSDictionary's "allValues" array, and it works fine. Is this expected behavior, or am I doing something wrong? F...

Binding an array controller to a 'derived' attribute - KVO problem?

Sorry for the clumsy title. Imagine a simple UI to display the first names of a person's children... As I initially only had one Person, I created an array controller and bound it to appDelegate.person1.children - this worked fine, as did binding a table column to display the first names. However, I have since extended my program so t...

Binding an NSTableView to an NSMutableArray

Here is this question version with images. I can't post it because of Stackoverflow policy concerning spam. Hello! I'm learning Cocoa, and I've got a problem: I would like to bind the content of an NSMutableArray to an NSTableView, with bindings. I read many documentations about them, but I can't manage to make them work (nothing is di...

Why will my nstableview not commit edits to rows?

so I have an NSTableView that I don't want bound to an NSArrayController, but I do want to use bindings. At the moment, its bound to a mutable array containing mutable strings. It works fine for editing a row, but when I try to get it to commit (deselecting it, hitting enter, various other weird quirks) it just refuses to do so. I rea...

Should I use NSObjectController here?

I've got a pretty standard setup: an NSArrayController whose contents are displayed in an NSCollectionView, and a pane of editable views bound to the array controller's selection (which is of course controlled by the collection view). For some reason, when I bind an NSObjectController's contentObject to the array controller's selection,...

Collection View Item binding issue

I have two entities in a Data Model, ENTITY_A, and ENTITY_B, that are related (ENTITY_A with a one-to-many relationship to ENTITY_B named DetailItems). I have set up a NSCollectionView with its appropriate bindings to ENTITY_A, and have placed on a Collection View Item a label. If I bind the label to [Collection View Item] and with a ...

How do I bind an iTunes style source list to an NSTableView using Core Data?

I have an iTunes style interface in my application: Source list (NSOutlineView) on the left that contains different libraries and playlists with an NSTableView on the right side of the interface displaying information for "Presentations". Similar to iTunes, I am showing the same type of information in the table view whether a library or...

Trouble with data not saving with bindings and shared NSUserDefaults in IB

I'm having a bit of a strange issue that I can't quite figure out. I'm somewhat of a n00b to Interface Builder. What I am trying to do seems like it should be simple, but it's not working for some reason. In interface builder I have a preferences window with a simple NSTextField. I have set the value binding to the Shared User Defaults ...

Programmatically binding Core Data to dynamic NSTableColumns

I have a Core Data application with two entities: Item and Entries. Item has a dataType string variable. Item has a to-many inverse relationship to Entries. Entries has two variables: stringData and numberData. I'm programmatically creating an NSTableColumn for each Item. The cell type of the column is defined by the Item's dataType var...

Construct NSTabView filling multiple NSTabViewItems by binding to DefaultUserPreferences...

So I have a single window applications with a NSTabView and I would like to populate a the NSTabViewItems by binding to DefaultUserPreferences that is connected to a plist like: --- <key>Tabs</key> <dict> <key>0</key> <dict> <key>tabName</key> <string>Default</string> <key>appUrls</key> <array> <string>file://localh...

Different cells in NSTableView together with bindings

Hi, im working on a nstableview that contains information for some properties that are dynamicly created. Each row contains some cells that are common (name for example), but in one column they have different cells. Some properties will have NSSliderCell, other NSButtonCell etc. All of this is binded up to a NSDictionaryController. I've ...

Binding to NSTextField Cell not working, edited value resets to default

I'm working on a Core Data document application that dynamically creates NSTableColumns. The data cell type may be a checkbox, slider, etc. Programmatically binding to all cell types works, except for NSTextFieldCell. All NSTextFieldCells fail to bind, and after editing they return to their default value. This happens no matter if they'...

NSTableView, NSArrayController and reload only after key press?

Hi folks, I have the following situation: There is one custom view inside of the first window that contains a NSTableView. There is a second window which acts as a form for the current object behind the selection of the table view inside the first window. Some more details: I’ve implemented the setDoubleAction: behavior in the NST...

[cocoa] NSSearchField not working as expected

Hi, I'm trying to follow Marcus Zarra in his book 'Core Data'. In the book, he makes a small sample application, but it doesn't give much help when things don't work out... He starts out by visually designing three entities, and then adding array controllers for each entity to the main nib. Second, he adds a tableview and some other vi...

When to release the model(representedObject) of the corresponding UIViewController.

Hi, In AppKit we have "representedObject" available through NSViewController, this representedObject is generally set to ModelController or the model which the NSViewController displays, this works great with bindings as you just set the new representedObject and model details are updated in the view, BUT in case of iPhone (UIKit, with ...

Populating an NSPopUpButtonCell with string values

I am trying to populate a NSPopUpButtonCell with a list of strings. In -(init), I populate an NSArray with the values I want in the PopUp Button. How do I connect this to the NSArrayController I added in IB? Does my app delegate need an IBOutlet NSArrayController to connect to or is there a way to bind it? Also, when I bind the NSArr...

What do you need to implement to provide a Content Set for an NSArrayController?

Heys, I am writing something in Xcode. I use Core Data for persistency and link the view and the model together with Cocoa Bindings; pretty much your ordinary Core Data application. I have an array controller (NSArrayController) in my Xib. This has its managedObjectContext bound to the AppDelegate, as is convention, and tracks an entit...

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 more NSObject instances of a model class. What I don't know how to do is expose the model i...

Update table columns bound to NSArrayController

Hi, I'm fairly new to the world of bindings in cocoa, and I'm having some troubles (perhaps/probably due to a misunderstanding). I have a singleton that contains an NSMutableArray called plugins, containing objects of class Plugin. It has a method called loadPlugins which adds objects to the plugins array. This may be called at any poi...

Storing arrays in NSUserDefaultsController

Currently I use NSUserDefaults and I'm interested in using NSUserDefaultsController, so that I get notifications when things change. Below is my current code. items = /* NSArray of MYItem's */; NSData* data = [NSKeyedArchiver archivedDataWithRootObject:items]; [[NSUserDefaults standardUserDefaults] setObject:data forKey:kMYItems]; Ho...