nstableview

Storing an NSImage in a Core Data Model

What is the correct way to store an NSImage in a Core Data Model? I have assumed adding an Attribute to an Entity and giving it the Type "Binary" should work, but it is not working. I have a table with a column of NSImageCells and it is not showing anything. ...

Double click an NSTableView row in Cocoa?

I need my application to open a window when a user double clicks on a row in an NSTableView. I'm having a bit of a difficult time finding information or examples on how to accomplish this. Can anybody point me in the right direction? ...

NSTableView and NSOutlineView drag-and-drop

I have an NSTableView and an NSOutlineView, both with their content provided by bindings, that I'd like to have some drag-and-drop functionality: Drag rows from Table A onto a row of Outline B, where they will be copied into a data structure which the row in Outline B represents. Drag a row from Outline B onto another row in Outline B,...

Text colors in an NSTableColumn on highlight

I've got an column of cells in an NSTableView that get their text color from the app's preference plist. I want to set the text color to white when highlighted, but have been unable to figure out a good way to do this. Anybody got any ideas? ...

Clickable url link in NSTextFieldCell inside NSTableView?

I have a NSAttributedString that I'm using in a NSTextFieldCell. It makes several clickable url links and puts a big NSAttributedString inside the NSTextFieldCell. Whenever I am viewing the NSTextFieldCell normally and it's highlighted, I cannot click on the links. If I set the TableView so I can edit each column or row, when I click tw...

Move focus to newly added record in an NSTableView

I am writing an application using Core Data to control a few NSTableViews. I have an add button that makes a new a record in the NSTableView. How do I make the focus move to the new record when this button is clicked so that I can immediately type its name? This is the same idea in iTunes where immediately after clicking the add playli...

How do I tell NSTableView not to resize all other columns when showing/hiding a column?

I have an NSTableView, and I have the ability for the user to show or hide columns dynamically (with a mail-style header context menu). My issue is that if the table view is currently wider than it's scroll view (i.e. it's displaying a horizontal scroll bar) when a column is hidden or shown it resizes every single visible column such th...

Delete object from array in NSTableView

Quick one. I'm overlooking something... I have a grouped table view that is built from arrays in an NSDictionary. Each array is a section of the table. When in editing mode and a user clicks "delete" I call - (void)removeObject:(MyClass *)myObject how can i determine which array to send the message [myArray removeObject:myObject]? N...

Multiple Selection in Cocoa's NSTableView without Command Key

Is there any way to achieve multiple selection behavior in an NSTableView without requiring the user to hold down the command button while clicking? This was easy to do in a Carbon list box, by ORing in the cmdKey modifier flag, during mouse down processing, on the call to the HandleControlClick() function. I am new to Cocoa, and it is...

Mouse event is not detected on my NStableview + cocoa

Hi Guys I have been trying this for past few days but couldnt figure it out. I have an application which has a NSOutlineView and a NSTableView. Outlineview takes input a path and displays them in the form of a tree structure its sub contents. So when ever a user clicks on a particular folder in the outine view, the contents of the fold...

NSTableView switch column

Hi, I have an NSTableView hooked up to Core Data. Here is what I want to do. The table has two columns. When I finish editing the first column, and press tab to go to the next column, I want to programmatically populate the second column based on the first column's data. Is there a delegate method that can help me with this? Thanks ...

When does selectedCell change?

I have an NSTableView and I want to do something whenever the selectedCell element changes. So, my table view is called tableView, and this is what I want to observe: [tableView selectedCell] I tried using key-value observing, but that didn't seem to work, or maybe I was doing it wrong. Any ideas? ...

How do I implement a customized list in Cocoa?

Hi, I want to build a Cocoa App with a list of entries very similar to the ToDo list of Things.app (see the screencast). The question is whether I should use a TableView, a CollectionView or a WebView. I think it could work with all of them, but which one suits the following requirements best? have a list of entries -> 1 column & ...

Getting to the managed objects in NSTableView

I have an NSTableView bound to an NSArrayController, which is bound to an NSManagedObjectContext with one Entity. How can I programmatically set a property on the object currently selected in the table view? I tried doing it directly through [[[documentsController arrangedObjects] objectAtIndex:[tableView selectedRow]] setObject:[NSDate...

NSTableView selection & highlights

Hi, I have a NSTableView as a very central part of my Application and want it to integrate more with the rest of it. It has only one column (it's a list) and I draw all Cells (normal NSTextFieldCells) myself. The first problem is the highlighting. I draw the highlight myself and want to get rid of the blue background. I now fill the who...

Can't make empty selection in NSTableView

I don't know how it happened, but all of a sudden in my table view I can't make an empty selection anymore. Like a table view row always has to be selected, and it can't be deselected by clicking somewhere else in the table view. I can select a different row, but I can't make an empty selection. In the Interface Builder attributes for t...

Add/remove rows to/from NSTableView in Objective-C

Hi all! I'm making a simple Todo application in Cocoa. I have added a class (and an NSObject to the XIB) MATodoController: MATodoController.h #import <Cocoa/Cocoa.h> @interface MATodoController : NSObject { IBOutlet NSTableView *table; } - (IBAction)addItem:(id)sender; - (IBAction)removeItem:(id)sender; @end MATodoController...

NSScrollView Bar not scrolling through NSTableView rows

Hello, I currently have an NSTableView inside an NSScrollView and this gets it's contents from a datasource. However, when the number of contents is larger than the view can hold, using the vertical scroll bar does not affect the contents of the table. Dragging the scroll bar doesn't work Clicking the Up/Down buttons doesn't work Usi...

NSTableView and NSPopUpButtonCell: How to detect when inline editing stops?

In my application, I use a NSTableView in which I allow inline editing. This inline editing is "buffered", which means that the user has to tab through all fields or press return to "commit" the edit. Pressing escape cancels the edit and reverts values. Up until now, I only needed text fields for inline editing, and I am successfully ab...

Table view not updating according to bindings

This is a very newbie question, and this is something I have done many times before, but there's something I'm missing this time. In my AppDelegate.h file I declare an NSArray and set it as a property: @interface AppDelegate : NSObject { NSArray *lines; } @property(readwrite, retain) NSArray *lines; @end And then in the AppDelegate...