cocoa-bindings

How to bind an NSOutlineView selection with other NSOutlineView?

Hi. Like the title say, I need bind the item selected in one NSOutlineView with another NSOutlineView. I got a collection of objects that has another collection inside, I want to show the first collection in one NSOutlineView and his sub-collection in a separate NSOutlineView. How con I do this? ...

Cocoa; Binding a Text Field to the sum of a filtered array (from an NSArrayController).

I have (for example) a table with cars in. The cars each have a name, a color and a mileage. I can have a text field which displays the total mileage of all the cars using bindings in interface builder: Value - Bind To: Car Array [email protected] However, I would like separate boxes for the total mileage done b...

Cocoa: Custom Controller Key for NSArrayController

Is it possible to create a custom controller key for an NSArrayController? There are keys for "arrangedObjects", "selection" etc... Is it possible to implement your own? I can't seem to find any info on this anywhere. My reason for wanting to do this (besides it seeming like a useful thing to be able to do) is: I have Entity "Car", wit...

Is the fact that NSPathControl does not escape percent ('%') characters when bound to a string a bug?

Steps: Environment: OS X 10.6.4 Xcode 3.2.1 Create a new "Application" project. Open the supplied application delegate. Add an NSString * property. In -applicationDidFinishLaunching: set the string property to @"/TestString%". Open up the NIB. Drag an NSPathControl onto the application window. Bind the NSPathControl's value binding to...

Is it possible to bind to a property of an NSArrayController?

Basically in IB where there are the options "arrangedObjects", "selection" etc in the "Controller Key" drop down, is it possible to create my own entry in there to bind to? If possible this would allow me to bind certain text boxes to filtered aspects of the array held by the ArrayController (and furthermore use operators like @count on...

Debugging COCOA Core Data bindings

Hi! In my document Core Data application I receive crash with report in console: Cocoa Bindings: Cannot create NSSet from object <_NSControllerObjectProxy: 0x26acb0> of class _NSControllerObjectProxy I have -NSBindingDebugLogLevel 1 startup vargument enebled and I get only this. Is there any way to get more information which class or ...

Cocoa Core Data: Using a value transformer on an array controller's arrangedObjects to provide a filtered count.

As per the title really. I have an entity which has a property "idNumber". Just as I can bind a text box to the array controller's arrangedObjects with Model Key Path "@count" to provide a count of all the objects in the array, I would like to be able to bind a text field to the array controller's arrangedObjects with a value transformer...

How do I create a Cocoa GUI to edit an array of NSDate objects?

In one app I am working on I need to let the user edit a list of dates. I have those NSDate objects in an array and bound that to a NSArrayController. I bound a NSTableColumn (the only column in a table view) to that array controller using the key path arrangedObjects.self. This works fine - I get all the dates displayed in the table jus...

How to use a single NSValueTransformer subclass to toggle the titles of multiple menu items

I would like to make some bindings that toggle item titles in a popup menu based on a single numerical value in a text field. Let me explain: This is my UI: I want my menu items to automatically adjust to singular or plural based on the number in the text field. For example, when I type "1" in the box, I want the menu items to be l...

Binding returns default value (set with registerDefaults:) instead of zero

Here's my setup: myTextField is bound to a key in the Shared User Defaults Controller. The user can only enter numbers in the text field. Each time my application loads, I load default preferences (from the app's Resources folder) using [[NSUserDefaults standardUserDefaults] registerDefaults: ... ]. myMenuItem's title is bound to the s...

Cocoa Bindings: Binding to the "many" end of a to-many relationship

Using the Employees-Departments example what I want to do is bind a column to "[email protected]" as outlined below: Entity Employee attributes: "firstName", "lastName", "hoursWorked" relationship: "departments" Entity Department attributes: "name" relationship: "employees" I want a table wh...

Is it OK for other threads to have indirect access to a managed object context running in a thread of its own?

Apple's recommended method for multithreading core data is to use a managed object context per thread, and to send changes from one context to another by saving the changed thread's context to a shared persistent store. While I can imagine that being fine for, eg. an RSS reader, for some applications it seems far from ideal. In my case,...

Drag and drop without implementing tableView:objectValueForTableColumn:row: and numberOfRowsInTableView:

I have an NSTableView with a single column, which gets its data through an NSArrayController bound to a Core Data entity. The data feed works great, and I have been able to get drag and drop working by implementing the methods – numberOfRowsInTableView: – tableView:objectValueForTableColumn:row: as well as the specific drag and drop me...

Starting a Cocoa document-based application shows selection window first.

This seems like it should be easy yet I must be missing something. I have a document-based application. I have also built a new XIB that has a NSTableView and three buttons on it that I intend to display a list of previous files. I wish this XIB to be displayed instead of the document window when the application first starts. Once th...

Managing arrays with NSArrayController

Hi, guys. I'm having trouble when managing arrays that are content of another array. : / I have the plist shown below as an ivar called tools on my Manager class: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt; <plist version="1.0"> <array...

NSTableView Issues...

I'm trying to follow this tutorial on binding: http://andrehoffmann.wordpress.com/2009/09/03/phonebook-tutorial-for-dummiesxcode-3-1-3/ but the app keeps crashing at run time. In IB I have a NSBUtton, NSTableView, NSArrayController and a NSOBject (named AppController) The tableview has 3 cols. Ad Name, Col and Height. In AppContro...

Binding to array controller in another nib for inspector window

Binding a popup menu to an array controller with the path selection.type works fine. Binding a popup menu to a document controller with the path currentDocument.arrayController.selection.type works one way only (changes in selection are not propagated to the popup menu). How can one achieve inspector-window-like functionality by bindi...

[Objective C: "Bindings"] How can I bind an NSTableView with 2D data at the backend ?

Hello there, I am new to mac, and I am in trouble. I need to bind NSTableView to 2D data at the back end so that I can have dynamic update of data at the front end. I have 5*10 data at the back end that I want to bind it to NSTableView. I have tried almost every approach, read every article, implemented examples from the internet but it ...

[Objective-C "Bindings"] How to refresh an NSTableVIew when you populate the NSMutableArray (bind) associated with it .

Hello there I just want to ask that I tried to bind my NSArraycontroller to an NSMutableArray, the array holds objects of type "iData" (its a custom class). The class further contains some NSMutableString variables, the variables are set as keys for KVC. Further i bind the my NSTableColumn to the NSArrayController and set key model paths...