nstableview

How to select one NSCell in an NSTableView?

I have a small NSTableView with a checkbox. Whenever the checkbox is not checked, I want one of the adjacent NSCells to be grayed out and inaccessible. However, I can't figure out how to address only one specific cell. -dataCellForRow of NSTableColumn always changes the template cell for the whole table column. How can I access one sin...

How do I edit a row in NSTableView to allow deleting the data in that row and replacing with new data?

I'm building a to-do-list application and I want to be able to edit the entries in the table and replace them with new entries. I'm close to being able to do what I want but not quit. Here is my code so far: /* IBOutlet NSTextField *textField; IBOutlet NSTabView *tableView; IBOutlet NSButton *button; NSMutableArray *myArray; */ #i...

NSTableView navigate with arrow keys

How can I navigate through my table view with the arrow keys. Much like setAction: or setDoubleAction, but instead of reacting to clicks, react with the arrow keys moving up or down through the table. ...

Coloring NSTableView Text per row

I have a NSTableView that is displaying an array of objects I have. For each of these objects (rows) I would like to change the color of the text displayed depending on the results of a function I run on each object; So for example all the object in the table that exist in another list (or some other requirement) I want to display them ...

How can I sort an NSTableColumn of NSStrings ignoring "The " and "A "?

I've got a simple Core Data application that I'm working on to display my movie collection. I'm using an NSTableView, with it's columns bound to attributes of my Core Data store through an NSArrayController object. At this point the columns sort fine(for numeric values) when the column headers are clicked on. The issue I'm having is...

NSArrayController not working with NSMutableDictionary for NSTableView

Hi all, I am trying to display content in NSTableView using NSMutableArrayController of NSMutableDictionary records. I followed steps written below: In application delegate class, I created an NSMutableArray object with name 'geniuses' and stored some NSMutableDictionary objects with keys: 'geniusName' and 'domain'. I took an NSArray...

Why does [NSOutlineView clickedRow] always return -1?

I have a fairly pedestrian non-editable NSOutlineView setup. In the bindings for the outline view, I have set the Double Click Target binding to my file's owner (MyDocument FWIW) with a selector of outlineViewWasDoubleClicked The method exists and is called, but when I call -clickedRow it consistently returns -1 rather than the row numb...

Add objects to NSDictionaryController

I have an NSTableView which is bound to an NSDictionaryController. I have set this and the content dictionary through the interface builder. The question I have is, how do I add objects to the dictionary in a manner that the controller will see it automatically and display it in the table. I've seen in examples about NSArrayController...

How to use NSTableView's selectedRowIndexes?

Hi guys, I'm just learning some basic programming in Objective C and Cocoa. I'm trying to get some data from NSTableView. Based on what I read in one tutorial, I wrote this: NSArray * items = [[itemsTableView selectedRowEnumerator] allObjects]; But then I learned that selectedRowEnumerator was deprecated already in 10.3 Panther and th...

jerky scrolling in NSTableView

Hello All, I have a NSTableView with around 70 - 80 rows, each row contain a checkbox, title text and a drop down menu to select data. The problem i am facing is that when i scroll the table it does not scroll smooth. When i remove the NSComboBoxCell it works ok. Here is the code i used to add NSComboBoxCell - NSTableColumn* ...

Core Data Image Won't Load Into NSTableView Image Cell

In my code I am storing an image into my Core Data model (works fine). If I set up my view to have an NSImageView and bind its Data to Controller Key: selection and modelKeyPath: myImagePath, it works. It will show each image for the selected row. I then create a new column in my NSTableView and drag an image cell onto the column. Howev...

Conditional column values in NSTableView?

I have an NSTableView that binds via an NSArrayController to an NSMutableArray. What's in the array are derived classes; the first few columns of the table are bound to properties that exist on the base class. That all works fine. Where I'm running into problem is a column that should only be populated if the row maps to one specific su...

Make NSFormatter validate NSTextFieldCell continuously

In Cocoa, I have an NSOutlineView where the cells are NSTextFieldCell. The cell displays values which are strings that are formatted according to certain rules (such as floats or pairs of floats with a space in between). I have made a custom NSFormatter to validate the text, and this seems to work with no problem. However, the cell (or ...

Binding CoreData Managed Object to NSTextFieldCell subclass

I have an NSTableView which has its first column set to contain a custom NSTextFieldCell. My custom NSTextFieldCell needs to allow the user to edit a "desc" property within my Managed Object but to also display an "info" string that it contains (which is not editable). To achieve this, I followed this tutorial. In a nutshell, the tutoria...

How can I get a nstableview to send an action when the user double-clicks an editable cell

I am trying to emulate the behavior found in finder and itunes. Single click on a selected object edits it. Double click opens the object. I have set the doubleAction of the tableView but like it says in the documentation. "If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead." I dont want this...

Simplest way to use NSTableView?

Can I use NSTableView like I've used ListView in Windows? By that I mean JUST adding rows to the view. I need to display a very simple two columned table and I don't want to write all this data related crap. Can I just 'add' stuff to a table view? If not what is the simplest way to do what I'm trying to do (preferably without data sour...

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

Simple NSTableView bindings example

I am trying to populate a 2-column NSVTableView via bindings, but the data is not showing up in the table. In XCode: I have a NSMutableArray in my AppDelegate that will hold the data, as well as the corresponding @property and @synthesize. On an event, I call [removeAllObjects] on the NSMutableArray and repopulate it with some NSDicti...

Binding value for NSTableView, but tooltip gets set as well

I've set up an NSTableView in Interface Builder to be populated from an NSArray. Each value of the array represents one row in the table. The value is bound correctly, but as a side effect, the table cell's tooltip is set to the string representation of the bound object. In my case, the NSArray contains NSDictiorany objects and the tool...

Getting Custom NSCell with NSButtonCell instance to handle mouse click/mouse events

OK I'm really stumped on this one. I want to make a checkbox with a NSTextFieldCell combined together. It's important that the checkbox goes ON if the mouse hits the box, NOT the text. I've accomplished this, more or less, but the issue is receiving the mouse event because I click one checkbox in a row, but ALL of them turn to NSOnState....