nsarraycontroller

Xcode Bind a Text Field to the Selected Item in a Table View From a Different ViewController

点点圈 提交于 2019-12-12 03:02:37
问题 Xcode 7, Swift 2, Mac OS X application. I have a Storyboard with the following simple structure; WindowController containing a SplitViewController. Top panel of Split View contains a ViewController which contains a Table View. Bottom panel of Split View contains a Text Field. My Table View is bound to an Entity in my data model using an Array Controller TableViewArrayController). The TableViewArrayController has been added to the Table View's containing View Controller. The Table View

Mac OSX - Core data isn't stored

自古美人都是妖i 提交于 2019-12-11 14:37:20
问题 In my app I use two table views that are bound to each their NSArrayController and the array controllers are set to use Core Data entities. When data is generated, an NSObject is created and values are stored in it with obj.setValue(_:forKey:) . After this the object is simply added to the array controller with ac.addObject() . Shouldn't this suffice to have Core Data taking care of persistent storage of the data? In any case, if I try to save the data by calling saveAction() it tells me that

How to make NSArrayController preservesSelection work for custom object?

无人久伴 提交于 2019-12-11 09:05:59
问题 I have a Cocoa app with a view-based table view bound to an NSArrayController with a list of custom Employee objects. The table view shows the list of employees. In a subview, the employee's details can be changed. Everything is set up, so that when an employee's details are changed, the table view contents are reloaded, showing the changes. So far, so good. Now NSArrayController has the ability to preserve the selected object across reloads via preservesSelection . For my custom Employee

Master-detail using bindings with TWO NSTableViews

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:42:39
问题 I have a list of objects displayed in an NSTableView (bound to an NSArrayController). When you select an object in that list I want to show a detail view in a second NSTableView. My object has an array property. I can't figure out how to wire the bindings for this. binding to NSArrayController's selection doesn't work, as that's a single object, and NSTableView expects to be bound to an array... 回答1: Create a second NSArrayController and bind its contents to the first controller using a

How to force NSArrayController to reload MOC contents to reflect latest fresh data

旧街凉风 提交于 2019-12-11 02:18:25
问题 I am working on a Mac & iOS App, with iCloud CoreData in between to synchronize the data. When I update some thing from iOS App, and the updates are already migrated to the PersistentStore in Mac App while the Mac App is running. The problem is I cannot find an effective way to force the NSArrayController to reload all data from the store. tried -(void) fetch:(id)sender; only can see the delete or added entity, but the updated model property not refreshed... Please help. Thanks 回答1: If you

Table view not updating according to bindings - Part Two

女生的网名这么多〃 提交于 2019-12-11 01:54:11
问题 Title borrowed from this question, of which this one is not a duplicate. See my answer there for what was wrong for that questioner; I'm the author of that answer, and my problem is not that one. I have a table view with three columns, whose Value bindings are bound to three properties of the arrangedObjects of an array controller. The array controller's contentArray is bound to the visitationResults of my document object; the items in that array are instances of a model class

What is the Cocoa Touch equivalent to NSArrayController?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 14:10:30
问题 Been starting to work with Core Data a bit, and while I've figured out how to use it in regular Cocoa applications, it seems it works a bit differently in Cocoa Touch. How do you bind entities to objects such as table cells in Cocoa Touch? 回答1: If you're using CoreData on iPhone OS 3.0 and above, you'll want to look at NSFetchedResultsController . While not really an analog to NSArrayController , it is designed specifically to be used with UITableView and its controller. It provides a way to

Keyboard focus lost after inserting and editing new object, when NSArrayController „Auto Rearrange Content“ is enabled

有些话、适合烂在心里 提交于 2019-12-09 23:48:13
问题 I have a master-detail kind of application OS X 10.9 only: An NSTableView on the left side of the window, the details as NSTextFields on the right side. I have not set the tab order specifically, out of the box works just fine. Except after inserting a new object: after inserting a new object the object is selected in the NSTableView. hit tab the first NSTextField is selected write something, hit tab now instead of selecting the next NSTextField nothing is selected, hit tab the NSTableView is

NSPopUpButton + Bindings + Show All Option

天涯浪子 提交于 2019-12-09 01:05:29
问题 I'm trying to develop a NSPopUpButton that will serve as a filter to some datasource, let's say a NSArrayController that fills a table. I can bind the NSArrayController from the menu to the selection keypath so the data is properly filtered, no problem with that. Tricky part is, I want the content of this NSPopUpButton to rely on an NSArrayController using bindings, but I'd like to add a "Show All" menu item, or at least some item that doesn't come from the Core Data and performs some special

NSArrayController rearrangeObjects error

前提是你 提交于 2019-12-08 06:46:12
问题 I have troubles with NSArrayController rearrangeObjects function - this function called from some background treads and sometimes App crashes with error: 'endUpdates called without a beginUpdates'. How can i detect if arrayController is rearranging objects in current moment and add next rearrange to some like queue or cancel current rearranging and run new? May be there is another solution for this problem? Edit code added: TableController implementation: - (void)setContent{//perfoms on main