nstableview

Dynamic row height for NSTableView in Swift/Cocoa

纵饮孤独 提交于 2019-12-06 11:40:32
问题 EDIT: The question was not answered by the linked reply. I'm still stuck on this... I've got a table that I use for chat messages. Each message is a variably-sized box including some text. I want the row height in my table to dynamically change depending on the size of the message box. If I tick 'automatic' for size style in IB, it makes all of the rows have tiny heights. It looks like iOS have UITableViewAutomaticDimension which automatically scales the table, but I can't find anything like

NSDictionaryController doesn't seem to observe changes to content dictionary

烂漫一生 提交于 2019-12-06 10:41:49
问题 I must be missing something simple, but I am having some trouble binding a tableView to an NSDictionaryController. Here is a model of my current scheme: TableViewColumn --bindsTo-->DictionaryController.arrangedObjects.(value or key) --bindsTo-->someClass.someClassMember.aDictionary. I've tested the tableView by adding an entry to aDictionary on init, which is displayed correctly. But when another method produces an object that is then added to aDictionary, the TableView doesn't seem to update

XCode Developer API - Object Library - Objects Disappearing

本秂侑毒 提交于 2019-12-06 08:35:05
问题 Fairly new to the Xcode Developer API and need a little help. When a project is first opened in Xcode, the Object Library displays the full list of UIKit objects available (and other linked frameworks I believe). However, when I switch files in the project navigator to/from any file (.m, .h, .xib, etc), the Object Library list changes; most of the objects are missing - such as NSButton, NSTableView etc. The standard objects are still visible - Label, Round Rect Button, Text Field, etc.

How Do you Drag-Move a Row in NSTableView?

∥☆過路亽.° 提交于 2019-12-06 08:32:39
问题 If it were an iOS project, letting the user drag-move the selected row would be relatively easy. I think it's something like - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ return UITableViewCellEditingStyleNone; } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } - (BOOL)tableView:(UITableView *)tableview canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return YES

CALayer + NSOutlineView/NSTableView

隐身守侯 提交于 2019-12-06 08:20:34
Here is the issue: a view-based NSOutlineView (or NSTableView, both have the issue) contains a custom control hosting a CALayer, for custom animation purposes. When resizing the outline view, or after deleting rows (animated deletion), the CALayer draws at the wrong place. This is just after an horizontal resize (the gray square is the CALayer): This is just after deleting the row where the gray square is missing (the gray square is the CALayer): It looks like the CALayer is drawn a little later than the view hierarchy itself, and in the case of the row deletion, isn't redrawn/removed at all.

Xcode Swift. How to programmatically select Cell in view-based NSTableView

依然范特西╮ 提交于 2019-12-06 07:38:59
问题 I can click a cell and edit its contents. But, instead of click/selecting a cell is it possible to programmatically select a cell - basically give a cell focus ready for editing. Somebody here on StackOverflow asked the same question about UITableView and the answer given was:- let indexPath = NSIndexPath(forRow: 2, inSection: 0) tableView.selectRowAtIndexPath(indexPath, animated: true, scrollPosition: .Middle) Does selectRowAtIndexPath select a cell? In any case, my NSTableView doesn't

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,

View based NSTableView EXC_BAD_ACCESS on Lion with ARC

不羁岁月 提交于 2019-12-06 06:59:54
问题 This is weird. I've got a super simple project to learn NSTableView, and it's set up in my nib, set as a View-based tableView. I've also set the dataSource and delegate to my controller obejct. When I do this, however, and run, I get an EXC_BAD_ACCESS, with the trace starting in my main function and the rest of the stack is internal to Cocoa (so not my code). There's really nothing fancy going on, other than this project is using ARC (it's a new project, so this was the default). I also tried

How to populate NSPopupButton from CoreData in View Based NSTableView

家住魔仙堡 提交于 2019-12-06 06:04:56
问题 I am using view based NSTableViews that is populated using bindings and array controllers with core data. Everything works great--cells with text and buttons and cells with image and text--I can edit the text as well, etc. What I can't figure out and have searched everywhere is how to populate the popup menu. There are 2 array controllers, one for table view and one for popup buttons menu items. I have tried binding the popup menu the classic way: by binding content (arrangedObjects to entity

Implementing drag and drop in NSTableView

谁说胖子不能爱 提交于 2019-12-06 05:05:22
问题 Can anyone help me to implement drag and drop in an NSTableView? I used this code below, but these methods are not getting called during execution. - (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard { // Copy the row numbers to the pasteboard. NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes]; [pboard declareTypes:[NSArray arrayWithObject:@".gif"] owner:self]; [pboard setData:data forType:@".gif"]; return