nstableview

How to set up a simple table view in Cocoa

Hello, I was wondering if anyone could give me an example or point me to some example code of how to use an NSTableView. I know how to use it in core data but I would like to do this just using plain cocoa code. All I need is a simple add and remove button. Also is it possible to have cocoa write the data to a text file or plist? Thank...

Multi-column sorting with an NSTableView bound to an NSArrayController

Hi there. I have an NSTableView that's bound to an NSArrayController. Everything gets loaded into the table correctly, and I have sort keys and selectors set for the various columns (this also works). What I'm trying to do is sort multiple columns when the user clicks one column header, but I can't find any way to do this. I could br...

What to subclass for clickedRow (NSTableView)

Which method should I subclass to change the drawing when a row is right-mouse clicked? (I want to change it in selecting the row). ...

NSTableView and NSSearchField in an NSView, which is the outlet of an NSMenuItem, don't work

I'm having an NSView, which is set as the view: outlet of an NSMenuItem. The view contains an NSTableView (inside an NSScrollView) and an NSSearchField. The NSMenu is shown when the user clicks a specific NSStatusItem. When I launch the application from Xcode (Build and Run), the controls behave well, but whenever I launch it from the Fi...

Problems with NSButtonCell action

For some reason the NSButtonCell for my table view is passing the wrong object as a parameter. I am trying to read the tag of the NSButtonCell after it is clicked. Here is a simplified version of my code: - (int)numberOfRowsInTableView:(NSTableView *)aTableView { return 3; } - (void)tableView:(NSTableView *)aTableView willDisplayC...

Different cells in NSTableView together with bindings

Hi, im working on a nstableview that contains information for some properties that are dynamicly created. Each row contains some cells that are common (name for example), but in one column they have different cells. Some properties will have NSSliderCell, other NSButtonCell etc. All of this is binded up to a NSDictionaryController. I've ...

Merged NSTableView with NSButtonCell problems

I successfully implemented the Merged NSTableView from the article by Dan Wood: http://www.mactech.com/articles/mactech/Vol.18/18.11/1811TableTechniques/index.html I am trying to make the cells be NSButtonCells, in general it works well, the only problem is that it only responds to the clicks done in the area of the original column, not...

Why for only some actions must I call setTarget?

For most actions, I just click and drag in InterfaceBuilder to "wire up" a call from some interface object to my code. For example, if I want to know when the user single-clicks a row in a table, I drag a connection from the table's action to my controller's action. But now let's consider the user double-clicking a row. If I want one of...

Why does Adding Core Animation slow down drawing of my NSTableView?

I have a simple App that displays a list of items using NSTableView. There are usually about 15-25 items in the list, and the table has 10 columns, all but one of which are text (the other's an icon.) There are simple data transformers on a couple of the columns. So nothing taxing; you'd expect it to run just fine. And as it stands, it ...

Cocoa: getting a Table View cell to send action messages

I'm really having trouble getting a Cocoa Table View cell to send action messages. At the most basic level, in IB there is an action assigned for the NSTextViewCell object, and after editing and pressing Return nothing happens. So I have an IBOutlet hooked up to the NSTextViewCell, and have been experimenting with NSActionCell messages...

Cocoa: how to nest a button inside a Table View cell?

Take a look at the top pane of the Xcode window. There's a table list, with checkboxes in one of the columns. That's the interface I want to do. So how do you nest a button in an NSTableView cell? ...

Valueurl Binding On Large Arrays Causes Sluggish User Interface

I have a large data set (some 3500 objects) that returns from a remote server via HTTP. Currently the data is being presented in an NSCollectionView. One aspect of the data is a path pack to the server for a small image that represents the data (think thumbnail for simplicity). Bindings works fantastically for the data that is already r...

NSTableView, NSArrayController and reload only after key press?

Hi folks, I have the following situation: There is one custom view inside of the first window that contains a NSTableView. There is a second window which acts as a form for the current object behind the selection of the table view inside the first window. Some more details: I’ve implemented the setDoubleAction: behavior in the NST...

Disable colour change when source list loses focus

When an item is selected in the source list it is highlighted in blue. When another element on the window is selected, however, the highlight becomes a lighter blue as the source list is no longer focused. I would like to change the behaviour so the item is always the darker blue, the same behaviour as seen in Finder. ...

Have more than one NSTableView with different Content - not displays data

I've two TableViews (one SourceList and one Normal TableView). I'm not using ArrayControllers, just using: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex; - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; this to display the Row Conte...

NSTableView setting the sort column?

I have a NSTableView with multiple columns. clicking each of the columns sorts by the column like in iTunes. However when the tableview first loads the rows are unsorted and no tablecolumn is highlighted or displaying the up/down indicator image. I'm wondering if theres a simple way I can programmatically set the column the table is sort...

Exposing model object using bindings in custom NSCell of NSTableView

I am struggling trying to perform what I would think would be a relatively common task. I have an NSTableView that is bound to it's array via an NSArrayController. The array controller has it's content set to an NSMutableArray that contains one or more NSObject instances of a model class. What I don't know how to do is expose the model i...

[Cocoa] NSTableView bound to NSArrayController

Within Interface Builder I've got an NSTableView with two columns bound to a vanilla NSArrayController. The NSArrayController has its Content Array bound to an NSMutableArray in my application delegate. I've used further bindings to setup the addition and removal of rows via bindings (magic!). The issue I'm running into now is that I'd ...

How to sort filenames correctly like Finder in objective-c

I am binding NStableView with NSMutableArray contiaining filenames and other file details. Simple biniding and sorting with compare: is not properly sorting file names like finder. Please let me know if i need to define custom selector for sorting filenames and how? ...

Cocoa class not displaying data in NSWindow

I have one class that controls one window, and another class that controls a different window in the same xib, however, the second window never displays what it should. In the first class I alloc and init the second class, then pass some information to it. In the second class it displays that data in the table view. Yes, in the .xib I ...