nsarraycontroller

Refresh Cocoa-Binding - NSArrayController - ComboBox

≯℡__Kan透↙ 提交于 2019-12-21 20:33:42
问题 in my application I made a very simple binding. I have a NSMutableArray bound to a NSArrayController. The controller itself is bound to a ComboBox and it shows all the content of the NSMutableArray. Works fine. The problem is : The content of the Array will change. If the user makes some adjustments to the app I delete all the items in the NSMuteableArray and fill it with new and different items. But the binding of NSMutableArray <-> NSArrayController <-> NSComboBox does not refresh. No

Binding selection across multiple view controllers in a single window interface

耗尽温柔 提交于 2019-12-19 04:49:06
问题 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 the architecture so that there is an NSWindowController that contains two NSViewControllers: one for the posts table on the left and one for the post details on

Binding an Ordered Relationship with an NSArrayController

浪尽此生 提交于 2019-12-18 11:57:49
问题 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 parent entity. This works fine, the data is accessible from the NSArrayController, no problem. I decided during development that it would be better to allow users to manually reorder these child objects, so I changed the relationship to an ordered

Binding a NSArrayController to a NSPopupButton & NSTextField

ぐ巨炮叔叔 提交于 2019-12-18 11:13:25
问题 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" }]; [[self controller] addObject:@{ @"name" : @"itemB", @"part" : @"partB" }]; [[self controller] addObject:@{ @"name" : @"itemC", @"part" : @"partC" }]; I am populating a NSPopupButton with the items in this array based on the 'name' key. This is

NSTableView Drag and Drop not working

橙三吉。 提交于 2019-12-13 14:15:00
问题 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 object. The data displays fine in the table. I connected the dataSource and delegate outlets of the table view to my controller object, and then implemented these methods: - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet

Core Data: How to update an NSArrayController immediately after adding an NSManagedObject?

匆匆过客 提交于 2019-12-13 07:36:08
问题 I am adding an instance in core data. The entity is represented by an NSArrayController . I would like to access the newly added instance through the controller. A "Skill" instance is added and then I try to access it through selectAddedObject as follows: -(void)addSkill { [self selectAddedObject:[NSEntityDescription insertNewObjectForEntityForName:@"Skill" inManagedObjectContext:self.managedObjectContext]]; } - (void)selectAddedObject:(NSManagedObject *)addedMO { [self.sectionArrayController

NSOutlineView and Core Data 1 → Many Relationships

 ̄綄美尐妖づ 提交于 2019-12-13 05:35:17
问题 I have a Core Data model that supports a 1 → Many relationship (1 Folder to many Phrases). At the moment I'm just displaying the Phrases on a flat NSTableView using Core Data Bindings to a NSArrayController to glue everything together - this is working happily. I'm trying to experiment with an NSOutlineView to achieve the same result but showing the folders as well. I've tried a similar binding structure that I'm already using with the NSTableView but I'm not making any headway. What steps

Cocoa binding to a particular item in an array controller

会有一股神秘感。 提交于 2019-12-12 12:07:28
问题 Is it possible using NSArrayController to bind a NSTextField 's value to a particular item in the array? In particular, I want to bind to a property on the first item in the array, and show nothing if the array is empty. Using arrangedObjects.command shows just "(" -- presumably it's trying to show a multi-line string with comma-separated strings for each item. I just want the first one. 回答1: Bind the text field to selection.command , and programmatically set the array controller's selection

Sectioned NSTableView using NSArrayController

你。 提交于 2019-12-12 07:49:32
问题 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 NSArrayController . I give you an example: I have different tasks. Each task has one of three different priorities, low, medium or high. The tasks also has attributes like title, description, date, etc. I want to section or group the tasks by

Document.xib contains two windows, one window needs to be a preference panel

混江龙づ霸主 提交于 2019-12-12 03:22:00
问题 I have created a Document-Based Application using Core Data. I replaced the automatically created window in Document.xib with two windows: a "Panel" window and a "Window" window. The "Panel" window contains a table view with bindings to an NSArrayController. The table view is used to add data to the array using the document class's entities and attributes. I would like to make this window act as a Preferences window. This window should appear when a button in the main "Window" is clicked. The