nsarraycontroller

Cocoa bindings problem; bound table columns don't show any data, no errors in console

I'm having trouble converting my Cocoa project from a manually-synched interface model to a bindings model so that I don't have to worry about interface glue code. I followed the CocoaDevCentral Cocoa Bindings tutorial to make sure that I had covered all the bases, but things aren't working correctly. I have a master-detail interface, ...

Using one NSArrayController from multiple XIBs

I'm having some problems displaying the contents of one NSArrayController in two windows defined in different XIBs. In my main window (in MainMenu.xib), I have an NSTableView which is bound to an NSArrayController In my second XIB, I have another window that contains an NSTableView. I created a new NSArrayController, and bound the tabl...

How to get some values from CoreData-Entities to code.

Hey guys! =) I've created in my CoreData app an entity with some attributes. Imagine a tableview and a bound NSArrayController. With both I create (and edit) my entity "instances". My question is how I can get the values of these attributes to my code. If there are more questions: http://twitter.com/xP_ablo ...

observeValueForKeyPath:ofObject:change:context: doesn't work properly with arrays

I have an object that implements the indexed accessor methods for a key called contents. In those accessors, I call willChange:valuesAtIndexes:forKey: and didChange:valuesAtIndexes:forKey: when I modify the underlying array. I also have a custom view object that is bound to contents via an NSArrayController. In observeValueForKeyPath:of...

Cocoa binding to a particular item in an array controller

Is it possible using NSArrayController to bind a NSTextField's value to a particular item in the array? In particular, I want to bind to a property on the first item in the array, and show nothing if the array is empty. Using arrangedObjects.command shows just "(" -- presumably it's trying to show a multi-line string with comma-separat...

Is it possible to use Cocoa's Bindings to have an editable NSTableView hooked up to an NSMutableArray?

It seems from the bits and pieces I can scrape together that the answer to this one will be "no", so I'll broadly explain what I'm trying to achieve in (the likely) case that I'm trying to hammer in a screw. What I have in my app is a list of valid file extensions to read in, which I'm recursing through a directory for. I want this to b...

Why isn't there NSArrayController for the iPhone?

Why isn't there NSArrayController for the iPhone? Will there ever be an NSArrayController for the iPhone? ...

Is it possible to have a binding that combines more than one key path?

Lets say I have an object which has a quantity value. Also, I have an array controller which holds an array of these objects. Furthermore, I have a table which has a percent of total column (i.e. the given row's quantity's percentage of the sum of the quantities for all rows), which needs to be populated with the proper value via bindi...

What is the correct way to tell when an NSArrayController is finished loading its content from a persistent store?

What's the best way to know when my array controller that is bound to my core data store is done loading its content? I've got some methods (i.e. awakeFromNib) that rely on the array controller having its content, but most of the time the array controller doesn't have its content yet when awakeFromNib is being called on that object. ...

Why does the row at the bottom of my outline view get deleted when I click the remove button rather than the one that is selected?

When I select a row in my outline view (connected to a NSTreeController) and click the remove button it doesn't delete the row that I have selected but actually deletes the row at the bottom of the table. For some more information here is my Connections for the Button: http://snapplr.com/t1hm and the Entity model: http://snapplr.com/k...

Index of the change in an NSArrayController

I'm programmatically observing the arrangedObjects of an NSArrayController and am having problem getting the index where something was changed. Is it at all possible to get the Index/IndexSet where the change occured. It seems like it should be, since NSKeyValueChangeIndexesKey is defined for the change-dictionary. When inspecting the ...

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 I need to add my view as an observer to every (relevant) attribute of every item added to...

What KVO notifications does NSArrayController look for ?

I have an NSTableView that binds to an NSArrayController, which in turn binds to an object property that returns an NSMutableArray. This array is listening for events in a separate part of the application and updates itself internally. The model object that owns an instance of the array does not make any changes to the array. I know th...

Cocoa: Binding to an array of NSStrings which are stored in the application's preferences

OK, I'm feeling really REALLY stupid for asking this question, but I've managed to stump myself so hard that I doubt I have the proper detachment to figure out the answer for myself any more. My apologies in advance... I have been playing around with bindings for a while now and LOVE them. That and the KVO/KVC conventions built into O...

Problem getting selected row index in NSTableView with filter predicate

Hi, I'm not sure I'm phrasing this properly, but basically I do this in my main app delegate: Application *app = [[Application alloc] initWithApplication:fullPath] The Application class has an initWithApplication method that takes in the path of an app and then sets the properties for appPath, name, etc. Then I add the new "app" objec...

NSCollectionView draws nothing

I'm trying to set up an NSCollectionView (I have done this successfully in the past, but for some reason it fails this time). I have a model class called "TestModel", and it has an NSString property that just returns a string (just for testing purposes right now). I then have an NSMutableArray property declaration in my main app delegat...

How do I delete an entity when removing it from an array controller?

I have an entity (e.g. Employee) in a managed object model that is related to two other entities (e.g. Department and Team). Both relationships are one-to-many (i.e. an Employee must have one Department and one Team, Teams and Departments have many Employees). The two may or may not overlap (e.g. a team might be made up of employees from...

Refresh Cocoa-Binding - NSArrayController - ComboBox

Hello in my application I made a very simple binding. I have a NSMutableArray bound to a NSArrayController. The controller itself is bound to a ComboBox and it shows all the content of the NSMutableArray. Works fine. The problem is : The content of the Array will change. If the user makes some adjustments to the app I delete all the it...

NSArrayController without Array

I just realized there are two ways to use a NSArrayController. Bind the Controller to and Array and add objects to the Array. Or don't use any Array at all and add objects directly to the Controller. [racesArray addObject: [[Race alloc] initWithName:@"Human"] ]; Or [myRacesController addObject: [[Race alloc] initWithName:@"Human"] ]...

What is the Cocoa Touch equivalent to NSArrayController?

Been starting to work with Core Data a bit, and while I've figured out how to use it in regular Cocoa applications, it seems it works a bit differently in Cocoa Touch. How do you bind entities to objects such as table cells in Cocoa Touch? ...