nsarraycontroller

Cocoa bindings problem; bound table columns don't show any data, no errors in console

时光怂恿深爱的人放手 提交于 2019-12-06 10:43:31
I'm having trouble converting my Cocoa project from a manually-synched interface model to a bindings model so that I don't have to worry about interface glue code. I followed the CocoaDevCentral Cocoa Bindings tutorial to make sure that I had covered all the bases, but things aren't working correctly. I have a master-detail interface, but I'm having trouble even getting the master portion of the interface to work correctly. No data is showing up in the master column, even though I've set up the bindings model similar to how it is shown in the tutorial. I've made sure all my controllers and

Filtering a single-column NSTableView using NSArrayController

筅森魡賤 提交于 2019-12-06 07:21:48
问题 I present a sheet with an NSTableView (one column), an NSSearchField and an NSButton ('Add'). What I want is to set the content of the table view to a list of strings. This list of strings is in an NSArray called list . This content should be filtered based on the content of the search field (if a string in list ) does not contain the content of the search field it is not shown in the table view anymore. I'm not familiar with bindings, can anyone help me out. 回答1: I have uploaded a project,

How to make Deep Copy of NSManagedObject in Core Data

让人想犯罪 __ 提交于 2019-12-06 03:16:00
问题 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 and copying all child objects. Any assistance is appreciated! Thanks to TechZen for the link. I used the sample code from that site and used this calling code:

Realm + NSTableView + NSArrayController

故事扮演 提交于 2019-12-05 21:58:07
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 feeded from a realm database. As you can see there is a checkbox for each row, which should set the bool value in the realm object. The bindings are ok, so if I mark/unmark the checkbox it seems to try writing on the realm object. But since realm needs a active write transaction, which will not be triggered, it crashes. My Question is: How can I write on

Create group rows in NSTableView using CoreData backed NSArrayController

丶灬走出姿态 提交于 2019-12-05 21:18:00
问题 Say I have a bunch of Article objects stored within the core data model. Each article maintains, a reading progress attribute which denotes how much of the article has been read by the user. Once the user has read the article fully, the article is marked as "Read". Before that, it would be marked "Unread". Now I have an NSTableView bound to a NSArrayController containing all the Article objects stored using CoreData. I want it to display all unread articles under an "Unread" group, and all

How do I delete an entity when removing it from an array controller?

三世轮回 提交于 2019-12-05 18:53:28
I have an entity (e.g. Employee) in a managed object model that is related to two other entities (e.g. Department and Team). Both relationships are one-to-many (i.e. an Employee must have one Department and one Team, Teams and Departments have many Employees). The two may or may not overlap (e.g. a team might be made up of employees from HR, Accounting & I.T. or it might jut consist of several employees from the one department). Department <-->> Employee <<--> Team I have two NSArrayControllers providing data for two NSTableViews, a Department table and a Team table. Employees can move between

KVO: +keyPathsForValuesAffecting<Key> doesn't work with (subclass of) NSObjectController

↘锁芯ラ 提交于 2019-12-05 09:39:18
I have a KVO-able class (call it Observee ), which affectedValue dynamic property is affected by affectingValue property. The dependency between the properties is defined by implementing +keyPathsForValuesAffectingAffectedValue method. Setting a value to affectingValue notifies that affectedValue has changed as I expected, unless Ovservee is a subclass of NSObjectController . Full example follows: @interface Observee : NSObject // or NSObjectController @property (readonly, strong, nonatomic) id affectedValue; @property (strong, nonatomic) id affectingValue; @property (strong, nonatomic)

How do I share an NSArrayController between two nib files?

不想你离开。 提交于 2019-12-04 23:49:25
问题 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 the two nibs to share the NSArrayController. I would have two separate NSArrayControllers bound to the same content, but I also want both nibs to share the

Filtering a single-column NSTableView using NSArrayController

佐手、 提交于 2019-12-04 12:17:45
I present a sheet with an NSTableView (one column), an NSSearchField and an NSButton ('Add'). What I want is to set the content of the table view to a list of strings. This list of strings is in an NSArray called list . This content should be filtered based on the content of the search field (if a string in list ) does not contain the content of the search field it is not shown in the table view anymore. I'm not familiar with bindings, can anyone help me out. I have uploaded a project , kindly check. A rough idea how to do is as: (however understanding is easier by seeing the project) Create

Refresh Cocoa-Binding - NSArrayController - ComboBox

半城伤御伤魂 提交于 2019-12-04 11:40:45
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 matter if I remove all objects from the Array the ComboBox still shows the same items. What is wrong here?