nsarraycontroller

Getting a unique identifier for each element of NSArrayController's content

I'm making a custom view that I want to be bindings/core data compatible and represent a collection of data (a la NSTableView) Is there any way my view can refer to a specific subset of the elements in the collection (other than the current selection) after a change by the user? A bit of context: The view is going to display a number o...

Problem binding an NSArrayController back to an ivar

Hi everybody, I have a problem with a bound property of a custom view. The property is bound to an NSArrayController for a core-data entity. Here's the problem: In my view, I draw several rectangles. The positions of these rectangles are saved in an entity in core data (as NSValue wrapped NSRects). The rectangles are draggable, and wh...

NSArrayController selection

Hello, I want to achieve the following: There is a list of persons (name, birthday, photo) I want to select a person name in the NSPopUpButton and show other details below. How can I do it using bindings only? I use NSArrayController to populate NSPopUpButton. I use NSArrayController.selection. to populate birthday and photo fields. B...

How to set indicator image on column with multiple sort descriptors?

NSDisableScreenUpdates(); [self.productsArrayController setFetchPredicate:predicate]; [self.productsArrayController setSortDescriptors:sortDescriptors]; [self.productsArrayController fetchWithRequest:[self.productsArrayController defaultFetchRequest] merge:YES error:nil]; NSSortDescriptor *lastSortDescriptor = [sortDescriptors lastObj...

Cocoa; Binding a Text Field to the sum of a filtered array (from an NSArrayController).

I have (for example) a table with cars in. The cars each have a name, a color and a mileage. I can have a text field which displays the total mileage of all the cars using bindings in interface builder: Value - Bind To: Car Array [email protected] However, I would like separate boxes for the total mileage done b...

Cocoa: Custom Controller Key for NSArrayController

Is it possible to create a custom controller key for an NSArrayController? There are keys for "arrangedObjects", "selection" etc... Is it possible to implement your own? I can't seem to find any info on this anywhere. My reason for wanting to do this (besides it seeming like a useful thing to be able to do) is: I have Entity "Car", wit...

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

Hi! 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 became quite complicated and it takes so much time to find wrong bindings (mistyped k...

How to make Deep Copy of NSManagedObject in Core Data

I am trying to make a duplicate of an existing NSManagedObject and related sub-objects in Core Data. I can't seem to find an easy way to do this. I have an NSArrayController that is populated from a Core Data database. I want to take the object at the selectionIndex and make a deep copy, keeping it related to the same parent object an...

How can I use custom sorting on an NSTableView bound to an NSArrayController?

I have an NSTableView connected to an NSArrayController by setting the column values in interface builder to the appropriate keys in the NSArrayController. I'd like to use a custom sorting order, specifically, compare:options: with NSNumericSearch. Where can I either change my code to do this, or tell interface builder to use a differe...

Collection was mutated while being enumerated crash with NSTableView, NSArrayController and NSThread

Hi! In my small Core Data application I have some NSTableView views binded with NSArrayController controllers in Entity mode. When I try to import some big amount of data to my table in background thread, after some successfully added imports (from dozens to hundreds items) I get crash with log: Serious application error. Exception w...

Managing arrays with NSArrayController

Hi, guys. I'm having trouble when managing arrays that are content of another array. : / I have the plist shown below as an ivar called tools on my Manager class: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt; <plist version="1.0"> <array...

Getting data from selected row in NSTableView linked with Core Data

Hey, So i am working on a Core Data app and I have an NSTableView linked with the Core Data. The table has three columns. Name, Position, Salary. I also set up a double click action. now what I need is that when I double click on a row i get the three values of that row. I can do the following: NSArray* myArray = [arrayController select...

NSArrayController -(selected object)-> NSUserDefaults

I have created a preference pane that allows the user to select a QTCaptureDevice. In Interface Builder, I bind a KVC-compliant method in my model class that retrieves an NSArray of QTCaptureDevices to an NSArrayController, which is in turn bound to an NSPopupButton. This all works; the list of QTCaptureDevices appears in my NSPopupBut...

[Objective-C "Bindings"] How to refresh an NSTableVIew when you populate the NSMutableArray (bind) associated with it .

Hello there I just want to ask that I tried to bind my NSArraycontroller to an NSMutableArray, the array holds objects of type "iData" (its a custom class). The class further contains some NSMutableString variables, the variables are set as keys for KVC. Further i bind the my NSTableColumn to the NSArrayController and set key model paths...