nstableviewcell

InterfaceBuilder NSButton connect to NSViewController Cause “Could not connect action, target class NSObject does not respond to”

依然范特西╮ 提交于 2020-01-24 19:35:16
问题 I have a view-based NSTableView whose "file's owner" is the ViewController . I dragged a button(for deletion) on the custom NSTableCellView , so I want to click the button and delete the current row from tableView, but when add a row the debug console tells me " Could not connect action, target class NSObject does not respond to deleteAction: " I m using the NSArrayController binding the NSTableView(add action is triggered successfully). I also got another weird problem, I try to subclass

How to create a NSTextFieldCell, that in edit mode displays a custom view instead of NSTextField?

两盒软妹~` 提交于 2019-12-22 00:09:28
问题 I have a tableView, with 3 columns containing NSTextFieldCell. Everything is populated with bindings. The text of the cells of one of the column is computed and is not editable directly. For this column, I would like when the cell goes into edit mode , to display a button or a custom view instead of the textField . Said in an other way, I want an NSCell that is a NSTextFieldCell when not being edited, and a NSButtonCell (or a custom view) when being edited. Any hint to move on to this? Here

Cocoa - View-Based NSTableView, using one cell in multiple tables

淺唱寂寞╮ 提交于 2019-12-21 18:06:22
问题 I've got a problem. [for which the only example I can find was shown during one of the WWDC 2011 presentations ("Maximising Productivity in Xcode 4"), but there is no source available (it was an app called Birdathon). Everything else I come up with is for iOS, and doesn't translate across.] Basically, I have some view-based NSTableViews, and currently lay out the image / text fields within my NSTableCellView directly in the column. I've got a subclass of NSTableCellView which gives me the

When NSTableview Load second time its customcell Subview's change it's position how to solve

廉价感情. 提交于 2019-12-11 11:42:11
问题 I am new for cocoa OSX application might be this question is simple but i try my best to find out this issue and at the end i asking question here. I am creating NSWindowViewController and in side it i Used NSTableview with Customcell. In customeCell i used NSView (customView) and all Cell IBOutlet put in side NSView. When First time that NSWindowViewController load that show fine but after close the window and again i open it. its NSTextField IBOutlet change its position top to bottom of the

Custom background colors for NSTableCellView

爷,独闯天下 提交于 2019-12-11 01:43:39
问题 I am trying to create a custom NSTableCellView. I subclassed NSTableCellView and I need to have a custom background color and highlight/selection color. Is there a way to do this? 回答1: the background as well as the selection is handled by the NSTableRowView view. It CAN (partly) be overwritten by the cell but that's not how it should be at all. Implement a custom rowview and return that for use behind the row you need to draw @interface MyRowView : NSTableRowView there you have:

NSTableView Cell with Identifier keep giving nil

℡╲_俬逩灬. 提交于 2019-12-10 18:51:15
问题 I am working on building MacOS app. I am trying to make table view that updates the cell when I press add button. Following is my code: func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { let identifier = tableColumn?.identifier as NSString? if ( identifier == "NameCell") { var result: NSTableCellView let cell = tableView.make(withIdentifier: "NameCell", owner: self) as! NSTableCellView cell.textField?.stringValue = self.data[row].setting!

NSButton in NSTableCellView: How to find desired objectValue?

家住魔仙堡 提交于 2019-12-07 10:06:54
问题 I have a view-based NSTableView that is populated through bindings. My textFields & imageViews are bound to the NSTableCellView's objectValue's properties. If I want to have an edit/info button in my NSTableCellView: Who should be the target of the button's action? How would the target get the objectValue that is associated with the cell that the button is in? I'd ultimately like to show a popover/sheet based on the objectValue. 回答1: Your controller class can be the target. To get the object

NSButton in NSTableCellView: How to find desired objectValue?

三世轮回 提交于 2019-12-05 15:22:08
I have a view-based NSTableView that is populated through bindings. My textFields & imageViews are bound to the NSTableCellView's objectValue's properties. If I want to have an edit/info button in my NSTableCellView: Who should be the target of the button's action? How would the target get the objectValue that is associated with the cell that the button is in? I'd ultimately like to show a popover/sheet based on the objectValue. Your controller class can be the target. To get the object value: - (IBAction)showPopover:(id)sender { NSButton *button = (NSButton *)sender; id representedObject = [

How to create a NSTextFieldCell, that in edit mode displays a custom view instead of NSTextField?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 17:28:32
I have a tableView, with 3 columns containing NSTextFieldCell. Everything is populated with bindings. The text of the cells of one of the column is computed and is not editable directly. For this column, I would like when the cell goes into edit mode , to display a button or a custom view instead of the textField . Said in an other way, I want an NSCell that is a NSTextFieldCell when not being edited, and a NSButtonCell (or a custom view) when being edited. Any hint to move on to this? Here is what I tried, without success: Try #1 : I subclassed a NSTextFieldCell and override

View based NSTableView selection highlighting

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 07:49:31
I am trying to port an iOS application onto the Mac and I came across a couple of issues during the transition. One of them is the customization of NSTableView . What exactly is the difference between NSCell , NSTableRowView and custom NSView based NSTableview ? I initially started out with a view based NSTableView , but I soon noticed that I would have to handle the selection myself. I could not pull that off, so I went on to use NSTableRowView , which, strangely, does not call the initialiser of my custom NSTableRowView . I basically just want a custom table view cell with custom contents,