nstableview

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't know how to do that. (example: When t...

Drag & Drop Reorder Rows on NSTableView

Hi, I was just wondering if there was an easy way to set an NSTableView to allow it to reorder its rows without writing any pasteboard code. I only need it to be able to do this internally, within one table. I have no issue writing the pboard code, except that I'm fairly sure that I saw Interface Builder have a toggle for this somewher...

NSTableView handling edititng cells correctly

Hi All, I have an NSTableView working correctly except when I'm editing one of the table items. If the user is still in edit mode, and it presses the Sheet OK button, the tableiew doesn't update. How do I force the tableview to commit the changes when the user press the ok button (closesheet). Also, how do I handle the ESC Key to cance...

Problem naming NSTableColumn

Hi, I'm trying to create a column with an empty string as the identifier but Cocoa seems to replace the empty string with the word "Field" every time I try to create the column. How do you go around this? - (void)addColumnWithCheckboxToTable:(NSTableView *)table { // Add column with checkbox before all other columns // This col...

Checkbox on table column won't register click

Hi, I've a table view to which I add columns dynamically. It must be done this way because I can't predict how many or which columns I will need. Some columns are checkboxes but I can't click on them when I run my application. The column and checkbox are set to be editable but if I click on the checkbox the check won't get set. Am I m...

NSTableView available for osx 10.0 but NsTableViewDataSource available for only 10.6?

I was looking at the docs for NSTableViewDataSource and they say that this protocol is only available on osx 10.6. How can this be? Isn't NSTableViewDataSource the object that contains all the data for your NsTableView? ...

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: but they never get called. After I set ...

NSTableView not displaying data

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

Display image in NSTableView

Now can I display an image in a table view. The big thing is there will be multiple data sources and each one has a different image. I'm using pubsub to get the data. Ex: data source 1 image -data -data1 data source 2 image 1 -data 2 -data 3 ...

NSTableView with multiple columns

What is an easy way to set up my NSTableView with multiple columns to only display certain data in one column. I have the IBOutlets set up, but I don't know where to go from there. ...

Which Cocoa view should I use for a list of messages?

I'd like to have a view that looks more or less like the message list in Tweetie (see screenshot) (no, it's not going to be a Twitter client, though it's similar ;). I'm not sure what Cocoa views should I use for that... I've mostly written stuff for the iPhone recently, and there's only one such control there (UITableView), but in AppKi...

Drop on NSTableView Behavior

Hi, I have an NSTableView and I have successfully implemented both tableView:validateDrop:proposedRow:proposedDropOperation: and tableView:acceptDrop:row:dropOperation:. I don't need tableView:writeRowsWithIndexes:toPasteboard: because that's for dragging objects out of the NSTableView. Now, the problem is that I want it to behave kin...

How do I get data from an NSTableView?

I have an NSTableView with two columns and a data source that fills it with data. That part works. How do I get data (NSString format) out of the NSTableView? I can get the selected row but NSTableView doesn't seem to have methods for accessing data. Getting the data from my data source seems to return useless data (type id and NSLog()...

Why will my nstableview not commit edits to rows?

so I have an NSTableView that I don't want bound to an NSArrayController, but I do want to use bindings. At the moment, its bound to a mutable array containing mutable strings. It works fine for editing a row, but when I try to get it to commit (deselecting it, hitting enter, various other weird quirks) it just refuses to do so. I rea...

Core Data Fetched Results Controller and Custom Section Header

I am familiar with the common and basic use of a NSFetchedResultsController managing the rows of a table, but I have an interesting problem. My data is organized as such: Schedule <--->> Day <--->> Route. I currently have a table view that has Schedules with a fetch controller managing the creation and deletion of Schedules. I now wan...

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 ...

Fixed Height NSTableView, Avoid Scrolling

I have an NSTableView that has a very small fixed number of rows. When I create an NSTableView in Interface Builder, the NSTableView is contained within an NSScrollView. I have not found a way to make the table exist outside the context of a scroll view. Since the table only has a small number of rows, I don't want it to scroll. I wa...

Inserting image into NSTableView using bindings

I've an NSTableView bound to an NSArrayController with two columns. One column is bound to the arranged objects of the array controller and displays a string. I'd like to display an image in the other column, but I just can't make it work. I've dragged an NSImageCell to the column and set the image by hand but it won't show up at runti...

NSTableView won't begin dragging rows if the mouseDown happens within the rect of an NSButtonCell.

I currently have an odd case where I need to be able to reorder rows in an NSTableView, but the only column happens to be an NSButtonCell. I'm trying to see how I can override NSButtonCell's mouse tracking in order to get it to behave in a way so that the NSTableView will begin dragging the row, but am not having much luck. Additional i...

setSelectsInsertedObjects on NSArrayController not actually selecting

I Have an NSArrayController bound to a NSUserDefaults controller, with setSelectsInsertedObjects set to YES in Interface Builder, but when I click Add, the previously select object gets unselected, instead of selecting the newly added object. What am I missing? ...