nstableview

Binding an NSTableView to an array of strings in Swift

南笙酒味 提交于 2019-12-19 10:07:56
问题 I'm showing the contents of an array of strings with an NSTableView via binding through an Array Controller. I have "NSString" in Class Name in the attributes inspector for the Array Controller and in the Model Key Path of the Array Controller's binding inspector I have the path to my array. And I have the only column of the table bound in its Value section to the Array Controller without Model Key Path specified (it's just an array of strings). As a result, the array's strings are displayed

How to know we reached the last row of NSTableView

非 Y 不嫁゛ 提交于 2019-12-19 08:54:02
问题 NSTableView is what I am using to display millions of data, which I can not get in response due to time out. So what I decided to get response in pages say 1-100 then 101-200 etc. So my problem starts here, how can I know that I have reached to the end of tableView or the cell is visible say 100th row? I dont want to implement Load More.. kind of button etc. After this I will send a new response with new range. Here is what I have tried so far: Tried to track the scrollView and get next set

Customize right click highlight on view-based NSTableView

♀尐吖头ヾ 提交于 2019-12-18 16:31:30
问题 I have a view-based NSTableView with a custom NSTableCellView and a custom NSTableRowView. I customized both of those classes because I want to change the appearance of each row. By implementing the [NSTableRowView draw...] methods I can change the background, the selection, the separator and the drag destination highlight. My question is: how can I change the highlight that appears when the row is right clicked and a menu appears? For example, this is the norm: And I want to change the

Using NSTableView Animations with Bindings

无人久伴 提交于 2019-12-18 10:55:16
问题 I have a NSTableView that is bound to a NSArrayController . The NSArrayController 's contentSet property is bound to a NSMutableSet . Everything works great. Now I want to use the animations built in to NSTableView to remove rows. I can do this with - [NSTableView removeRowsAtIndexes:withAnimation:] and the row quickly animates away, however the object I removed from the tableview is still hanging out in the NSMutableSet that is backing the tableview. Obviously I need to remove it. If I try

How to setup a NSTableView with a custom cell using a subview

可紊 提交于 2019-12-18 09:39:36
问题 I am trying to setup a NSTableView with a custom cell using an ArrayController and Bindings . To accomplish this I added a subview to the custom cell. The data connection seems to work somewhat. Though, there seems to be a redraw problem which I cannot fix. When I load the application only some of the cells are rendered. When I scroll through the rows or select one the rendering changes. I created an example project on github to illustrate what the problem is. The actual source code for the

Custom drag image with NSTableView as drag source

做~自己de王妃 提交于 2019-12-18 08:24:45
问题 Is it necessary to subclass NSTableView or NSTableCellView to create a custom drag image when the tableView is the drag source? If not, what is the magic method I am missing to do this? I cannot seem to find anything solid. NSTableCellView subclasses have can (slightly mysteriously) override: @property(retain, readonly) NSArray *draggingImageComponents (array of NSDraggingImageComponent instances that will get composited together (who knows in what fashion they get composited...)) NSTableView

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

NSTableview View Based Scrolling Performance

元气小坏坏 提交于 2019-12-17 23:09:01
问题 I am fairly new to OS X Cocoa programming but have decided to give it a go with the new Swift language. I have an NSTableView with 1500 rows (will be more) and 7 columns. There is one checkbox column and the rest are text fields, one with a date formate and one a currency formatter. I first set this up as cell based. Scrolling was buttery smooth (I even did a test adding 1 million rows, still smooth). This was under mavericks. I then upgraded to Yosemite , scrolling performance significantly

Automatically adjust height of a NSTableView

帅比萌擦擦* 提交于 2019-12-17 22:35:22
问题 I have asked this question once before, but I'm just not very satisfied with the solution. Automatically adjust size of NSTableView I want to display a NSTableView in a NSPopover , or in a NSWindow . Now, the window's size should adjust with the table view. Just like Xcode does it: This is fairly simple with Auto Layout, you can just pin the inner view to the super view. My problem is, that I can't figure out the optimal height of the table view. The following code enumerates all available

View based NSTableView editing

邮差的信 提交于 2019-12-17 18:07:04
问题 I'm not sure what I'm doing wrong. Since I couldn't find any other questions (or even documentation) about this, it seems do be normally working without problems for other people. I'm simply trying to get a view based NSTableView to do support editing of it's content. I.e. the app displays a NSTableView with one column and several rows, containing a NSTextField with some content. I want to be able to (double) click on a cell and edit the cell's content. So basically the normal behavior of a