nsarraycontroller

Observer properties of objects in an NSArrayController

I am trying to get the old and new values of the objects in my NSArrayController using KVO. The values passed into the change dictionary are nil though. I have an NSArrayController and I have a class Model with a property name that use cocoa's @property and @synthesize to insure that they are KVO compliant. @property (retain) NSString ...

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...

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,...

Binding selection across multiple view controllers in a single window interface

I am having an issue wrapping my head around how to hook up a few NSArrayControllers across two view controllers. I want to sync the selection in the source list table view to update the values in the second detail view controller. I'm using the Cocoa Dev Central Build A Core Data Tutorial as the starting point, but have broke down ...

setSelectsInsertedObjects on NSArrayController not actually selecting

I Have an NSArrayController bound to a NSUserDefaults controller, with setSelectsInsertedObjects set to YES in Interface Builder, but when I click Add, the previously select object gets unselected, instead of selecting the newly added object. What am I missing? ...

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...

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...

Have more than one NSTableView with different Content - not displays data

I've two TableViews (one SourceList and one Normal TableView). I'm not using ArrayControllers, just using: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex; - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; this to display the Row Conte...

insert and modify a record in an entity using Core Data

I tried to find the answer of my question on the internet, but I could not. I have a simple entity in Core data that has a Value attribute (that is integer) and a Date attribute. I want to define two methods in my .m file. First method is the ADD method. It takes two arguments: an integer value (entered by user in UI) and a date (curr...

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...

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...

Different results from array controller and fetch request for relationship with nil value

I'm using a simple NSComparisonPredicate similar to: ("employeeDepartment != %@", department) where employeeDepartment is an optional, one-to-many relationship in Employees, and department is an NSManagedObject of Departments. When applied against the Employees entity, I'm getting different results from an NSArrayController vs an NSFetch...

[Cocoa] NSTableView bound to NSArrayController

Within Interface Builder I've got an NSTableView with two columns bound to a vanilla NSArrayController. The NSArrayController has its Content Array bound to an NSMutableArray in my application delegate. I've used further bindings to setup the addition and removal of rows via bindings (magic!). The issue I'm running into now is that I'd ...

Cocoa @sum array operator too slow - alternatives?

I've got a text field value bound to a key path that uses @sum. When the array controller is filtered, the text field updates properly, but extremely slowly, lagging the UI or outright beachballing after every key press (less so as the number of items in arrangedObjects decreases). There is no lag if I don't use @sum; I've narrowed it do...

Invalid receiver type 'NSUInteger'

I have a Core Data entity whose header file looks like this: @interface MyEntity : NSManagedObject { } @property (nonatomic, retain) NSNumber * index; @end And it's implementation file looks like this: @implementation MyEntity @dynamic index; @end Now, I have a piece of code that looks like this: NSArray* selectedObects = [myE...

Observing model changes with Cocoa Bindings and NSArrayController

I've got an NSArrayController bound to a mutable array in my controller, which manages an array of my model objects. The array controller is bound to my UI. It works well. Now I'm trying to manually observe when a value changes in my model in my controller class (basically I'm marking the changed model as "needsToSave" for later on, but...

Subclassing NSArrayController in order to limit size of arrangedObjects

I'm trying to limit the number of objects in an array controller, but I still want to be able to access the full array, if necessary. A simple solution I came up with was to subclass NSArrayController, and define a new method named "limitedArrangedObjects", that returns a limited number of objects from the real set of arranged objects. ...

NSArrayController that is sorted and unique (no duplicates) for use in a pop-up in a core-data app

I have core data app with an entity OBSERVATION that has as one of its attributes DEALNAME. I want to reference through Interface Builder or by making custom modifications to an NSArrayController a list of unique sorted dealnames so that I can use them in a pop-up. I have attempted to use @distinctUnionOfSets (and @distinctUnionOfArrays...