nsarraycontroller

NSArrayController not working with NSMutableDictionary for NSTableView

Hi all, I am trying to display content in NSTableView using NSMutableArrayController of NSMutableDictionary records. I followed steps written below: In application delegate class, I created an NSMutableArray object with name 'geniuses' and stored some NSMutableDictionary objects with keys: 'geniusName' and 'domain'. I took an NSArray...

How do I share an NSArrayController between two nib files?

I have an array of images, and two nib files. One nib file has a window that displays the images in an NSTableView. The other nib has a window that draws the array of images into an NSView, and also draws a highlight over the images that are selected. The array of images is controlled by an NSArrayController. I'm having trouble getting ...

Simple NSTableView bindings example

I am trying to populate a 2-column NSVTableView via bindings, but the data is not showing up in the table. In XCode: I have a NSMutableArray in my AppDelegate that will hold the data, as well as the corresponding @property and @synthesize. On an event, I call [removeAllObjects] on the NSMutableArray and repopulate it with some NSDicti...

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 from the controller. I know I can do this the easy way when connecting the button with the ...

Laggy interface with NSSearchField hooked up to an NSArrayController via bindings

So I've got an NSSearchField hooked up directly to an NSArrayController via bindings, attached to the filterPredicate, so that without any code, the user can just type in the NSSearchField and filter the list of objects in the NSArrayController presented to him in the interface (an NSCollectionView, to be specific). The NSSearchField is...

Temporarily disabled NSArrayController filterPredicate, or consult ManagedObjectContext?

I have an NSArrayController which is bound to a class in my Managed Object Context. During runtime the NSArrayController can have a number of different filter predicates applied. At certain intervals, I want to iterate through my NSArrayController's contents regardless of the filter predicate applied to it. To do this, I set the filter...

how to show avg of employees salary in a NSTextField using NSArrayController and cocoa bindings

Hi all, I am new to cocoa bindings so I tried to make a simple application which will simply calculate avg of employees salary and display it in a text field, using cocoa bindings. I followed these steps: Made the model class : Person with one property for now - @property (readwrite, assign) int salary; In the application delegate cl...

Sorting of table column by string length not working as intended when done in IB via cocoa - bindings

Hi all, I made a sample application displaying list of employees with their salaries over NSTableView using NSArrayController. Basic functionality is working as intended. Also sorting is working fine when Selector - compare or caseInsensitiveCompare is assigned in attribute pane for table column- employeeName. Problem occurs when I tr...

Singleton NSMutableArray accessed by NSArrayController in multiple NIB's

Early warning - code sample a little long... I have a singleton NSMutableArray that can be accessed from anywhere within my application. I want to be able to reference the NSMutableArray from multiple NIB files but bind to UI elements via NSArrayController objects. Initial creation is not a problem. I can reference the singleton NSMutab...

Using NSSegmentedControl with CoreData

I have a Core Data app that works to add or remove one of a Client's many Appointments with buttons bound in IB to my appointments ArrayController. The appointments content is derived from whichever Client is selected in a feed list. I wish to use a SegmentedControl, and as far as I could tell, this requires I programmatically add and r...

Why is NSArrayController not calling accessor methods via bindings?

I am trying to intercept an NSArrayController (thingsController) addObject method with the following accessor method. - (void)insertObject:(Thing *)thing inThingsAtIndex:(NSUInteger)index; I have two classes: Thing and MyDocument. Thing has one property: name. MyDocument has an NSMutableArray called things and an NSArrayController ...

Elegantly add object to arraycontroller, which itself is linked to another arraycontroller?

Hello everyone I'm new to Mac programming but generally liking it. I have the following problem: I have two core data entities linked through a one-to-many with their respective arraycontrollers (Stock Controller and Price History Controller, where the latter controller is bound to the Stock Controller, with Controller Key = selection ...

how to get count of records and aggregate of values via NSArrayController and cocoa bindings

Hi all, I am trying a simple application using NSArrayController and cocoa bindings. The application contains - a table with only one column, two buttons "+, -" to add and delete records, two text fields to show count of records entered and sum of these records. To allow user to enter numbers only, I have assigned NSNumberFormatter to ...

cannot find Array Controller in Interface Builder

Hello, I'm just starting to use core data in my iphone app. I have created my Entity (measure) with 2 property (date, value). According to the tutos I'm reading, I then need to create an Array Controller in Interface Builder. The thing is... I cannot find it in IB. Is there something to configure to have this type of controller in the li...

Core Data: Sort to-many relationship in NSTableView

Hello experts, I have troubles getting my NSTableView keep the contents of a to-many relationship ordered. What I have is an entity "Relationship" in a to-many relationship with an entity "Card" both managed by an NSArrayController. Card has 2 attributes, "number" (int) and "name" (String) displayed via Bindings in two columns of a NS...

NSArrayController : removeAllObjects does not refresh TableView

In my application I add objects directly to an ArrayController. When I want to clean all items I do: [[downloadItemsController content] removeAllObjects]; This command however does not refresh the TableView the arraycontroller is bound to. If I remove all items and add another new items I only see that item. That is fine but if I don'...

Core Data: When and where are Entities loaded in the first Place?

Hello experts, I have a question about Core Data. When starting my appliction, when is my data (which is stored automatically by Core Data) loaded into the NSArrayControllers? I want to modify it in the first place before the user can interact with it. To be more specific: I have an NSArrayController for the entitity Playlist. Before t...

Sectioned NSTable view with NSArrayController

Hello, I am trying to create a sectioned NSTableView using bindings with an NSArrayController or multiple NSArrayControllers. Basically the data container is an array within an array. Do I bind an NSArrayController to the parent collection and then bind another NSArrayController to a child collection? Is this the right approach? Thank...

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... can anyone explain with some sample code? For instance, if I have a GameModel which repre...

Showing serial nos. in a table column using NSArrayController and cocoa bindings

Hi all, I have a simple question: How to show serial nos. or (row no. + 1) in a table column using cocoa bindings and array controller? I have made an application using cocoa bindings and array controller, in which I am displaying names of certain persons in a table column. The class from which I am displaying is named as: Perso...