nstablecolumn

Sorting NSTableColumn contents

情到浓时终转凉″ 提交于 2021-02-06 10:55:43
问题 I have a problem with sorting NSTableColumn contents. In my NSTableView there are three columns: File, Size, Path. The contents are stored in NSMutableArray. Each object in this array is a NSDictionary containing three keys: file, size and path - value for each is a NSString. In Interface Builder, in each Table Column's attributes I can choose sorting options: Selector: IB entered "compare:" which I think is ok, because I compare NSStrings. Sort Key - and that's the problem I think - I don't

NSTableColumn binding using Collection Operators like @sum

荒凉一梦 提交于 2020-01-14 04:24:10
问题 Mac OS X. CoreData app. NSTableView controlled by NSArrayController bound to managed object context for the Country entity. The Country entity has a 'name' attribute and a to-many relationship, 'branches', to a Branch entity. The Branch entity has a 'sales' attribute (an NSNumber). The NSTableView has two NSTableColumns. The first shows the name of the Country. The second should show the total sales for that Country across all its Branches. The first column's value is bound to the

How do I select column and row from a NSTableView?

给你一囗甜甜゛ 提交于 2020-01-06 18:01:28
问题 I am writing a NSTableView based view. And I try to use: let selectedRowNumber = tableViewMesos.selectedRow and let selectedColumnNumber = tableViewMesos.selectedColumn to identify the textField that is in the cell View that I want to save into my array: taulaDeConsumsMesos[selectedColumnNumber].filesConsum![selectedRowNumber] = sender.doubleValue But a problem happens here, because the return value of selectedColumnNumber is -1 which is the value of non-selected Column for any row selected

Problem naming NSTableColumn

回眸只為那壹抹淺笑 提交于 2019-12-22 09:03:36
问题 I'm trying to create a column with an empty string as the identifier but Cocoa seems to replace the empty string with the word "Field" every time I try to create the column. How do you go around this? - (void)addColumnWithCheckboxToTable:(NSTableView *)table { // Add column with checkbox before all other columns // This column will have no title and should be as wide as the checkbox NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@" "] autorelease]; // The checkbox is to be

Create view based NSTableView programmatically using Bindings in Swift

僤鯓⒐⒋嵵緔 提交于 2019-12-18 05:15:15
问题 I am working through a Cocoa in Swift book and I am stuck in a chapter on Bindings. The book uses nib files but I want to do everything programmatically (since I am joining a team that does not use nibs). The project is to create a view based table with 2 columns and the content of the table is bound to the arrangedObjects of an array controller. The array controller's content is bound to an array of Employee objects (Employee has 2 properties viz. name and salary). I was able to create the

About the automatic table column identifier

可紊 提交于 2019-12-11 04:38:58
问题 I have create a NSTableView and 2 NSTableColumn in the view. Both of the identifiers of these 2 NSTableColumn set to "Automatic" in Interface Builder. In the method: (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row I use NSLog(@"%@", [tableColumn identifier]) to check the identifier of these 2 NSTableColumn. I found the identifier of the first column is AutomaticTableColumnIdentifier.0 but the second is (null) . Is there any

How to bind data to a NSTableView from a NSDictionary?

笑着哭i 提交于 2019-12-10 13:49:21
问题 Does anybody knows how to fill up a NSTableView using binding values from a NSDictionary? Thanks in advance. 回答1: You need to create an NSDictionaryController in Interface Builder. Bind it to your dictionary, and then bind the NSTableView to the objects in the NSDictionaryController . Look here: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSDictionaryController_Class/Introduction/Introduction.html If you don't yet fully understand Cocoa Bindings and KV coding, you

Why are my images in my NSTableView faded out?

喜你入骨 提交于 2019-12-09 10:51:26
问题 To start, there's an NSArrayController ("Servers") whose content is an array of "server" objects. I also have an NSTableView with a column. The column is bound to Server's "arrangedObjects.status" property. I use a custom NSValueConverter to make that status into an image for the column's dataCell which is an NSImageCell . What I don't understand is why the images that show up in the column are correct, but consistently faded out. Just to test, I have the same image outside the table view for

Checkbox on table column won't register click

此生再无相见时 提交于 2019-12-08 01:36:37
问题 I've a table view to which I add columns dynamically. It must be done this way because I can't predict how many or which columns I will need. Some columns are checkboxes but I can't click on them when I run my application. The column and checkbox are set to be editable but if I click on the checkbox the check won't get set. Am I missing something? Update How I'm (trying) setting the state on the checkbox: - (void)tableView:(NSTableView *)theTableView setObjectValue:(id)theObject

Problem naming NSTableColumn

偶尔善良 提交于 2019-12-05 11:55:59
I'm trying to create a column with an empty string as the identifier but Cocoa seems to replace the empty string with the word "Field" every time I try to create the column. How do you go around this? - (void)addColumnWithCheckboxToTable:(NSTableView *)table { // Add column with checkbox before all other columns // This column will have no title and should be as wide as the checkbox NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@" "] autorelease]; // The checkbox is to be initialised without a title NSButtonCell *checkbox = [[[NSButtonCell alloc] initTextCell:@" "]