Questions tagged [nstableview]

1

votes
1

answer
1.3k

Views

NSTableView Delegate Called But Data not showing

i have a very strange problem with NSTableView in XCode 4.2. I've set the datasource an delegate for the table. My table has 3 columns where each of the column has an identifier ('name','mugshot','lastSeen'). My delegate -(id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableCol...
Martin
1

votes
0

answer
184

Views

NSTableRowView selected row background colour

I have a custom table row view that lets me set the background colour of the selected row: import Cocoa class MyRowView: NSTableRowView { override func drawSelection(in dirtyRect: NSRect) { NSColor.black.setFill() dirtyRect.fill() } } This works fine for any columns containing NSTextFields, where I...
Brickers
1

votes
1

answer
27

Views

Mac app makes the computer unexpectedly reboot

I've encountered a pretty weird bug in my macOS app. When I do specific things in my macOS app, my computer just restarts unexpectedly without any warnings or errors. Any other applications work just fine and the same behaviour is not experiencing while using them. Has anyone of you ever faced somet...
Dmitriy Kirakosyan
1

votes
2

answer
65

Views

Mac OSX app : Issue Related to NSArrayController NSTableView Core data Adding Record

I have using NSArrayController NSTableView and Core data binding. I have take one button and connect add: method of NSArrayController to its action. On Adding new record TableView added and shows new record. NSArrayController's add: method called Problem : Value is not added into core data (Sqlite...
S. S
1

votes
0

answer
48

Views

NSTableView detect row scrolled off

I have a view-based NSTableView and each row has to generate some images which takes time. These are done on a background NSoperationQueue and started when a request for an image is made (through a binding). When a row is scrolled off screen, if the NSOperation is still pending, I'd like to be able...
Trygve
1

votes
1

answer
117

Views

Columns added programmatically to NSTableView not recognised in Delegate

I may be lost in a glass of water but I can't seem to be able to add columns to a NSTableView that are then recognised in the NSTableViewDelegate. I create a table in IB with one column and give the column a string identifier. The I add the other columns in the View Controller: override func viewDi...
Marco
1

votes
1

answer
298

Views

Using type select on only one column with NSTableView in Swift

I'm working in XCode 9.3, Swift developing an application for MacOS. I've created a table that currently has two columns. I want to use type select that only acts on one column so that when the user types the first few letters, it only selects within the first column and not in the 2nd column. The...
RickshawBoy
1

votes
0

answer
40

Views

How do I customise the drag/drop insertion marker on an NSTableView or NSOutlineView

I am implementing drag and drop functionality on an NSOutlineView. I want to support dropping between rows and dropping on a row. I am currently setting the draggingDestinationFeedbackStyle to 'regular' which by default gives a row highlight when dragging on to a row, and a circle-and-blue-bar inser...
Giles
1

votes
0

answer
46

Views

How Do I Stop NSTableView Drag Images Shrinking When Leaving The Table?

I have an app with multiple NSOutlineViews, in one window, with drag and drop enabled and working. I can successfully drag items from one outline to another. When dragging within a single outline, I automatically get a nice image of the rows I am dragging next to the mouse, the same size as the sour...
Giles
1

votes
0

answer
58

Views

How to detect text in NSTableview?

I am trying to find out how to detect text in NSTableView. There are many ways to do it and I have tried it all without success. I am using macOS 10.13 and swift 4 and I am new to swift coding. I want to detect text in targetInput and then use the text to fill other cells. I have the following code...
zack_ii
0

votes
0

answer
15

Views

2 NSTableViews 1 ViewController. Cells in second tableview not appending data to rows

The second table view cells are being populated with 'Table View Cell' even though the inActiveComputers array is populated. tableView1 is successfully populated with the activeComputers array. both tables have the datasource, delegate, and referencing outlets set to MainView though IB. I'm at a...
Mark Doyle
1

votes
1

answer
107

Views

Permanently hide rows in NSTableView / NSOutlineView

I have some rows in my NSOutlineView that I would like to be permanently hidden (for reasons to do with my data structure). On 10.13, using automatic row heights and auto layout, I was able to simply have no view for some rows of data, and so they were hidden to the user. Now I am making my app avai...
Giles
1

votes
1

answer
38

Views

Subclassed NumberFormatter in NSTableView not formatting

I have subclassed a NumberFormatter for my specific use and it's working great when I call it from code. Here's the subclass: class MyNumberFormatterUnitPrice: NumberFormatter { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setup() } override init() { super.init() setup() } p...
hocker
1

votes
1

answer
71

Views

nstableview + cannot show partial file names

I am using Table View Control. In the control, I show File/Folders details, if I reduce the size of file/folder name column, it does not show partial file/folder name (whatever characters can be shown in the Column). If a file name has multiple words in it, if enough space is not there to show a wo...
King
1

votes
1

answer
2.5k

Views

How to set background color of cell with NSButtoncell type in NSTableView?

This is my table view delegate: - (void)tableView:(NSTableView *)tableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)tableColumn row:(int)row { id theRecord; NSMutableString *gid; theRecord = [tableDataSource objectAtIndex:row]; gid = [theRecord objectForKey:@'gid']; if (([gid intVal...
Irwan
1

votes
1

answer
1.2k

Views

How do I check if a NSView is being displayed at the moment?

I got an application which has a NSToolbar in its main window. Depending on which icon is clicked a NSView is displayed in this window. My problem is, that one of these views shows data in a NSTableView that I want to be reloaded each time the view is visible. Since -init is only called once, I don'...
Zhyniq
1

votes
1

answer
1.5k

Views

Setting up an NSTableView programatically (catching tableView:objectValueForTableColumn:row:)

I am trying to setup an NSTableView programatically (I really need to avoid using IB) and all the examples I find explain how to do this using the interface building. I have created a controller class that implements the methods tableView:objectValueForTableColumn:row: and numberOfRowsInTableView:...
Mike2012
1

votes
1

answer
2k

Views

NSTableView not displaying data

Here's my code: test.h @interface testAppDelegate : NSObject { NSWindow *window; IBOutlet NSTableView *test; NSMutableArray *internalArray; } @property (assign) IBOutlet NSWindow *window; @property (nonatomic, retain) NSTableView *test; -(id) initWithArray: (NSArray*) objects; -(int)numberOfRowsInT...
Matt S.
1

votes
1

answer
875

Views

How to auto resize table column when double clicking on Cocoa?

I want to auto resize table column to its content width when double clicking its header (resize cursor is showing), like on iTunes. Anyone know how to do it ? Thanks in advance
Irwan
1

votes
1

answer
2.5k

Views

Nstableview group style for nsoutlineview

I like the look of the group rows in the nstableview. In apple mail, the group sections like mailboxes and rss with that style too. Is there an easy way to make a group row or root item in an nsoutlineview to look like that? I think I have to override the willDisplayCell method...
joels
1

votes
1

answer
210

Views

NSTableView not refreshing

I have a table view that gets refreshed two different ways. Both are through a button, and as a matter of fact, both are through the same IBAction in the same class! Here's my problem: The buttons are in two different .xib files, the button in the same xib as the table view works perfectly, while t...
Matt S.
1

votes
2

answer
860

Views

NSTableView and data validation?

In order to properly learn Objective-C and the Cocoa framework, I have started building a CoreData application, but I'm a bit at a loss on how to properly provide data validation when an item is being edited in an NSTableView. My model has an entity called 'Business' with two string properties: a na...
Dimitris Batis
1

votes
2

answer
406

Views

Getting a unique identifier for each element of NSArrayController's content

I'm making a custom view that I want to be bindings/core data compatible and represent a collection of data (a la NSTableView) Is there any way my view can refer to a specific subset of the elements in the collection (other than the current selection) after a change by the user? A bit of context: Th...
Chris Devereux
1

votes
1

answer
348

Views

How to know which NSTableView opened a Contextual Menu?

I have 5 NSTableView's instances that have the same contextual menu. When I get the message that the menu has been clicked I need to know which table sent it. I've checked the NSMenu documentation but I don't seem to find a way to check which of the tables opened the menu.. I'm thinking of subclassi...
the Reverend
1

votes
1

answer
1.3k

Views

NSTableView Drop App File, Whats Going Wrong?

I have the following code to support dropping an app file into a table view. The problem is that I don't even see the green + when I drag and drop. I think it has something to do with the registerForDraggedTypes: but I'm not sure. I've tried many tutorials and none have worked for me. - (void)awakeF...
nosedive25
1

votes
1

answer
720

Views

NSOutline View Drag-n-Drop Problem

Dear All, I am fighting with NSOutline View to perform drag-n-drop within the table since last 2-3 day but couldn't get what i am doing wrong, This is what i have done so far, Requirement, 1 -- I want to have a transparent or with some background image NSoutlineview in my view, to do that, i nee...
Amitg2k12
1

votes
1

answer
483

Views

Cocoa Bindings + NSArray + custom class

I can't get my head around this: I have an instance of NSMutableArray filled with custom Lesson objects. These objects have two properties: name and selected. I'm trying to use these Lesson objects in an NSTableView. One column should show the name as a string, the other selected as check box. I us...
fabian789
1

votes
2

answer
610

Views

NSTableView with more than one UI element in NSCell (like Transmission)

How would I make an NSCell with more than one UI element in it and display it in an NSTableView? For NSCells with a single value I could implement tableView:objectValueForTableColumn:row: but I don't know how to do this for NSCells with more than one. At the moment I have an NSView in an NSCollectio...
Jibo
1

votes
2

answer
557

Views

Reloading NSTableView on re-focus

In my application, I have a NSWindow that has a NSTableView object and a few buttons. When the user presses the 'new' button, an 'ItemAdd' NSWindowController is activated where the user types in attributes for the item to be added to the NSTableView. My question is this: since NSTableView requires...
Poff
1

votes
1

answer
1.5k

Views

NSImageCell change image problem

I'm working on an app that shows a list of data on an OutlineView. The controller receives notifications that tells it to change the image of the status NSImageCell of a row. The problem is that I couldn't managed to refresh the cell on the row of the OutlineView. So far I've tried each of the opti...
mikywan
1

votes
2

answer
677

Views

NSTableView Cell Display Issue

I'm using a view-based NSTableView, and I've ran across a little issue. I'm trying to switch the text color of my two labels from black to white when highlighted. To do so, I've written the following code, - (void)tableViewSelectionDidChange:(NSNotification *)notification { NSView * viewInQuestion =...
evdude100
1

votes
2

answer
718

Views

Implementing NSOutlineViewDataSource using MonoMac

I'm trying to implement a datasource for an NSOutlineView. The problem is that I don't know what type of object to return from outlineView:child:ofItem:. Current code looks like this: [Export('outlineView:child:ofItem:')] public NSObject childOfItem(NSOutlineView outline, int child, NSObject item) {...
Sander Rijken
1

votes
1

answer
398

Views

Hyperlinks in an view-based TableView (NSTableCellView)

I have an view-based TableView with an image and a NSTextField. I've got some links inside my NSTextField and I have tried many options (http://developer.apple.com/library/mac/#qa/qa2006/qa1487.html, dsclickableurltextfield) but nothing works out, because it seems that these options only fit to an c...
Mceee
1

votes
1

answer
929

Views

How to retrieve the current selection of an NSPopUpButtonCell?

I am using an NSPopUpButtonCell in an NSTableView. The popup button has a binding to an NSArray property offered by the ApplicationDelegate. When I select a menu item of the popup button I expect to retrieve the current selection or its index. I added an IBAction to being informed and also set up a...
JJD
1

votes
2

answer
940

Views

NSTableView rowViewAtRow: always returning nil

I'm trying to display an NSPopover with additional information to a selected row of an NSTableView. For that I need to get a reference to the view representation of the selected row so I can 'attach' my popover to it: NSInteger row = [[self membersTableView] selectedRow]; NSTableRowView *aView = [[s...
Roger
1

votes
1

answer
618

Views

NSArrayController too late for NSTableView datasource?

So, I instantiate an NSWindowController, which in turn instantiates a .xib. The xib has NSArrayControllers, which populate their array with NSManagedObjects. The window controller has an (mutable) array property, which serves as datasource for an NSTableView in the .xib. I have the NSTableViewDataSo...
Fnord23
1

votes
1

answer
140

Views

Resizing NSTableView makes text not clear

I have this problem that when I setframe of the parent view of the NSTableView the text goes unclear and blurry (doubled text over others), but when I switch tabs between application or click in a row the text go right again, I was trying to call tableview setNeedDisplay with no results? do you have...
Nidal Saed
1

votes
1

answer
1.5k

Views

NSButton gets drawn inside custom NSCell, but is not actually clickable

I have a NSTableView which contains my custom NSCell subclass, IconCell. The IconCell contains three elements : an image, text, and a button. Here's a simplified version of my drawing code (closeButton is the button): - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { NSP...
houbysoft
1

votes
1

answer
203

Views

How to reload a table from another class? - Cocoa

I've been trying to do this for a while, I have a tableViewController class and my AppDelegate class and the tableViewController class is the datasource for the table obviously. But I want the table to load on startup and I can't figure out any other way to do this than call the table loading method...
drewsdunne
1

votes
2

answer
870

Views

NSArrayController + NSTableView : automatically save changes without Core Data

OK, so I'm implementing a classic scenario : A NSPopupButton with some items in it When the selected value changes, my itemsArray is updated The itemsArray is linked to an NSArrayController Each item in the itemsArray is an NSMutableDictionary (with keys : title,content) An NSTableView displays the...
Dr.Kameleon

View additional questions