Questions tagged [nsarraycontroller]

on Mac OS X, NSArrayController is a bindings compatible class that manages a collection of objects

NSArrayController is a Cocoa class intended to bridge an array (instance of NSArray or its subclasses) and a suitable view, for instance a table view.

It provides a simple interface to add, remove, filter and sort the array, as well as the necessary bindings to interface these functions to Cocoa actions.

More information in the official docs

531 questions
21
votes
1 answer

Key Value Observing with an NSArray

I've looked on SO for examples of using Key Value Observing with an NSArray (or NSMutableArray) and apparently you need to use an NSArrayController (which unlike KVO I'm not familiar with), but I haven't found concrete examples of how to do this.…
cannyboy
  • 23,724
  • 40
  • 138
  • 242
19
votes
1 answer

Binding a NSArrayController to a NSPopupButton & NSTextField

What I want to accomplish seems like it should be fairly straightforward. I have placed a sample project here. I have a NSArrayController filled with an array of NSDictionaries. [[self controller] addObject:@{ @"name" : @"itemA", @"part" : @"partA"…
ericg
  • 7,324
  • 6
  • 39
  • 66
15
votes
5 answers

What are the reasons for subclassing NSArrayController?

I am trying to improve my KVC/KVO/Cocoa-Bindings-fu and was wondering what could be the reasons to subclass the NSArrayController?
Eimantas
  • 47,394
  • 15
  • 127
  • 164
15
votes
1 answer

Using an NSArrayController in Multiple Storyboard Scenes

I have a Mac document-based Core Data application that uses storyboards. The storyboard has the following layout: Window Controller Split View Controller Table View Controller Text View Controller My Core Data model contains a…
Mark Szymczyk
  • 17,064
  • 3
  • 51
  • 61
14
votes
2 answers

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?
user100051
14
votes
2 answers

Sorting a NSArrayController backed NSTableView

I have a NSArrayController and a NSTableView. They show tracks from iTunes. I can sort the list by clicking in the header. Is there a way to set up a default sort descriptor for the table view so it sorts for albums every time the user launches the…
david
  • 3,304
  • 4
  • 26
  • 39
13
votes
1 answer

NSArrayController + View based NSTableView binding to NSTextField

I have a view based NSTableView. An array controller. Set content of tableview to array controller's arrangedObjects. Set content of array controller to a NSMutableArray of a custom object. Binding table cell view's NSTextField's value to the array…
ssj
  • 871
  • 1
  • 10
  • 21
13
votes
1 answer

Set value in CoreData with three related NSPopUpButton

I hope to express myself with appropriate terms. I have three entities: customer, country, state. Between country and state, there are two relationships. So I can create a number of countries and select one of these I can create a number of states…
Andrea
  • 427
  • 3
  • 16
11
votes
2 answers

Binding an Ordered Relationship with an NSArrayController

How does one bind an NSArrayController's content to the entities in an ordered to-many relationship? I have an unordered to-many relationship in my Core Data model, and an NSArrayController whose Content Set is bound to that relationship from the…
Khakionion
  • 702
  • 7
  • 20
9
votes
3 answers

Sectioned NSTableView using NSArrayController

I'm trying to create a sectioned NSTableView using NSArrayController and cocoa bindings. I'm searching for a similar approach like with NSFetchedResultsController in iOS, where you can set a section key path. I want to make something similar with…
burki
  • 2,666
  • 4
  • 33
  • 49
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
1 answer

Editable table view bound to NSArrayController bound to NSUserDefaultsController

I have a simple model Foo that represents a user preference and encapsulates an NSString and an NSNumber. I want to store an array of Foo’s in user defaults so that they persist between launches of the application; and I’d like to display them in an…
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
1 answer

Mac OS X replacement for NSFetchedResultsController

So I'm used to iOS development so I'm pretty happy with NSFetchedResultsController. However, this is not present in the Mac OS X environment. I know that I can use NSArrayController as a replacement. I might be using this class terribly wrong but it…
lbrndnr
  • 3,327
  • 21
  • 35
8
votes
3 answers

NSArrayController initialization

I am having trouble getting an core-data backed NSArrayController to work properly in my code. Below is my code: pageArrayController = [[NSArrayController alloc] initWithContent:nil]; [pageArrayController setManagedObjectContext:[self…
CJ.
  • 1,034
  • 1
  • 9
  • 20
1
2 3
35 36