nstableview

NSTableView + NSSegmentedControl + NSSegmentSwitchTrackingSelectAny

混江龙づ霸主 提交于 2019-12-24 22:25:24
问题 I've got a table view which has an NSSegmentedCell for its right-most column. The NSSegmentedControls which the cells are pulled from are using the "any" tracking mode (aka: multiple selection) and the segments are selected based on a bitfield with possible values: 1, 2, and 4. A value of 1 means A|b|c. 2 is a|B|c. 4 is a|b|C. 3 is A|B|c, etc... That bitfield is returned by the data sources's tableView:objectValueForTableColumn:row: method and the cell is returned in the delegate's tableView

Keep same NSTableView scrolled position while inserting rows

ⅰ亾dé卋堺 提交于 2019-12-24 10:57:42
问题 I've got a view-based NSTableView showing a timeline of messages/informations. Row heights are variable. New messages are regularly added at the top of the table by using insertRows : NSAnimationContext.runAnimationGroup({ (context) in context.allowsImplicitAnimation = true self.myTable.insertRows(at: indexSet, withAnimation: [.effectGap]) }) While the user stays at the top of the table, the messages keep being inserted at the top, pushing down the existing ones: a usual behavior in this

How to change NSTableView header background color in MAC OS X app?

守給你的承諾、 提交于 2019-12-24 08:08:20
问题 I've tried all found suggested solutions but ended up with this as the closest: The target is to have custom color for: complete header background (e.g. green) text (e.g. white) sort control color (e.g. white) Currently I can only set the interior bg and text color properly while leaving the header borders and sort controls in default white color. I use the approach of custom NCTableHeaderCell . // <C> changing the bgColor doesn't work this way [self.tv.headerView setWantsLayer:YES]; self.tv

Simple NSTableView bindings example

二次信任 提交于 2019-12-24 07:26:21
问题 I am trying to populate a 2-column NSVTableView via bindings, but the data is not showing up in the table. In XCode: I have a NSMutableArray in my AppDelegate that will hold the data, as well as the corresponding @property and @synthesize. On an event, I call [removeAllObjects] on the NSMutableArray and repopulate it with some NSDictionary objects. Each dictionary contains 2 KVP's: a NAME and a VALUE. In IB: I added an NSArrayController and bound it's Content Array to my AppDelegate and set

Change border corlor of NSTableView

大憨熊 提交于 2019-12-24 03:15:00
问题 Can I change the color of NSTableView's border . The gray line at the pointer. Thanks. 回答1: You need to SubClass your NSScrollView . NSScrollView doesn't usually do any drawing, and probably has a weird interaction with its child views in that way. I'd suggest putting something like - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; // We're going to be modifying the state for this, // so allow it to be restored later [NSGraphicsContext saveGraphicsState]; // Choose the correct

how to copy rows from NSTableView

泪湿孤枕 提交于 2019-12-23 19:31:07
问题 I have one NSTableView, Which displays just the row of numbers. I just want to copy those numbers using (cmd+copy) or right click copy. How can I achieve this feature in NSTableViews. 回答1: By default, the edit menu (cut/copy/paste/etc) is auto-enabled, provided the text in your tableView row is selectable or editable, and the text field in question is in the responder chain. The auto-enabled menu items work by looking at the responder chain. If the 1st responder responds to the selector that

NSTableView unhideRowsAtIndexes crashes

Deadly 提交于 2019-12-23 05:45:12
问题 I am creating a grouped NSTableView that loads just fine and with all my objects the way I want to. I also created the possibility to collapse entire group sections (the rows between group rows) and I use the hideRowsAtIndexes:withAnimation: and unhideRowsAtIndexes:withAnimation: that were added to NSTableView ( https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/#10_11TableView). Hiding always seem to work, but unhiding crashes for some rows. The last row hides and unhides

Problems when deselecting checkboxes inside bound NSTableview's columns

徘徊边缘 提交于 2019-12-23 04:24:10
问题 I am using this project, created by aneesh171 that shows the creation of checkboxes inside NSTableView and how to bind them. I am new to OSX development and trying to understand how it works. The project is basically checkboxes inside a NSTableView's column that is bound to an array controller. For some reason, when I deselect one of those checkboxes, the following messages appear on the console window: 2014-04-03 04:22:55.579 MyApp[5735:303] Error setting value for key path objectValue

How to handle extremely large CoreData store in NSTableView?

喜欢而已 提交于 2019-12-22 11:28:11
问题 Say you have a core data entity with more than 10,000,000 objects in a sqlite backed core data store, how do you effectively display all that information in an NSTableView? In particular, how do you efficiently sort, filter and display in infinite scroll mode? 回答1: I'd use NSArrayController. See the documents for more info. 来源: https://stackoverflow.com/questions/8626280/how-to-handle-extremely-large-coredata-store-in-nstableview

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