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

532 questions
3
votes
1 answer

Cannot remove an observer ... for the key path "..." from ... because it is not registered as an observer

I have a Core Data model with two entities: A and B. A has a relation to one or more Bs. B has a property bValue. I create many instances of a class and some of them invoke a notification. This notification called a method that creates a new B…
Daniel
  • 1,473
  • 3
  • 33
  • 63
3
votes
0 answers

Swift macOS NSTableView very slow

I'm working in Swift (macOS) and have an NSTableView, the contents of which are bound to an NSArrayController. The tableView cells can set/edit the data using a mix of Strings and NSPopUpButtons across the cell's nine columns, which are managed via…
jbm
  • 1,248
  • 10
  • 22
3
votes
1 answer

Modeling user-orderable lists with Core Data / Bindings

I'm working through a learning project around Core Data on OS X. I have an entity (Foo) in the data store, and in the UI, I use an NSArrayController with bindings to put some (name) field of the Foo objects into an NSTableView, where the user can…
Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
3
votes
1 answer

Cocoa Bindings and Custom NSCell properties

I have a problem regarding subclassed NSCells (Check Box Cells). I want them to have a title and a subtitle next to the checkmark (so I created NSString properties for these). Their values shall be set via Bindings (from the IB would be awesome) but…
3
votes
1 answer

How to observe changes to the items contained by an NSArrayController

I have an object containing an NSMutableArray called pointValue and several methods including setPointValue. When the latter method is invoked it triggers another method saveTable which saves pointValue to a file (its a csv but does matter not here…
3
votes
1 answer

NSArrayController remove: doesn't result in "selectionDidChange"

I have an array of objects, call them I1 objects. Each I1 object contains an array of I2 objects. ArrayController1 controls objects of type I1, displayed in TableView T1. ArrayController2 controls objects of type I2, displayed in TableView T2. I…
John Velman
  • 688
  • 9
  • 16
3
votes
7 answers

NSTableView Drag and Drop not working

I'm trying to set up very basic drag and drop for my NSTableView. The table view has a single column (with a custom cell). The column is bound to an NSArrayController, and the array controller's content array is bound to an NSArray on my controller…
indragie
  • 18,002
  • 16
  • 95
  • 164
3
votes
1 answer

Manual binding with NSTableColumn (without NSArrayController)

I want to use bindings in a table view, but I'm not using an NSArrayController. I've tried binding an array to my NSTableColumn (I'm handling sorting/searching myself), but it doesn't work. Is there some sort of magic under the hood that…
jasonbogd
  • 2,451
  • 4
  • 31
  • 42
3
votes
4 answers

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…
Andy
  • 30,088
  • 6
  • 78
  • 89
3
votes
1 answer

Realm + NSTableView + NSArrayController

i have some Problems with my macOS Application and hope you can help me. Im pretty new on macOS so please be nice ;) A part of the app consists of a simple NSTableView which content is binded to an NSArrayController. The NSArrayController is…
Peter C. Glade
  • 543
  • 2
  • 8
  • 16
3
votes
0 answers

Cannot use Add: action for NSTextField bound to NSArrayController

I have a view (created in a StoryBoard) that has a couple of NSTextFields and a slider control. I have one NSTextField that that takes the value of the another NSTextField and a sliderValue. When I click the "Add" button (which is connected to the…
3
votes
1 answer

NSArrayController Class vs Entity mode in Core Data Mac OS X document based application

Can anyone explain differences in practise between NSArrayContoller modes (Class / Entity}? I am just facing some debugging issues in my document based Core Data desktop application (using Entity mode for all my controllers). My database structure…
Lukasz
  • 19,816
  • 17
  • 83
  • 139
3
votes
0 answers

How do you bind the selectionIndexes of an NSArrayController to an NSCollectionView?

I have a storyboard view controller scene the contains an NSArrayController object and an NSCollectionView. The bindings of the collection view look like this: The bindings of the array controller look like this: This seems like it should be…
Rik
  • 493
  • 1
  • 3
  • 12
3
votes
3 answers

NSArrayController bind it to sort descriptor using the nib

I'm trying to figure go to set sort descriptor in binding for NSArrayController but I have not be able to find a example of how to do it. I have a NSArrayController bind it to core data and I want to sort the data. My question is how I can do this…
user2924482
  • 8,380
  • 23
  • 89
  • 173
3
votes
3 answers

Cocoa : Remove Item from NSArrayController

I have a NSArrayController bound to a NSTableView. With this I have the typical Add/Remove buttons. While Adding an item is very straight forward (I call a method, create an object with default values and add it) I have problems deleting objects…
TalkingCode
  • 13,407
  • 27
  • 102
  • 147