nstableview

Table view cell, custom editor and editing frame

Hi! I am using a custom editor when editing the contents of a cell inside a Table view. From the docs I see that the custom editor has to be an NSTextView. So I put the text view in the document view, then I referenced it from the cell subclass through an IBOutlet in order to assign it as custom editor. When doing all this, I can set t...

Implementing NSOutlineView/NSTableView with different cells (and data types) per row.

I'm wondering how one would implement an outline view like the one Xcode 3 is using for the build configuration: When using an NSOutlineView/NSTableView with bindings and an NSTreeController/NSArrayController, the view's columns get bindings assigned to, not the individual cells, for obvious reasons. If every row in a column uses the ...

Display icon and text in same cell of NSTableView

I would like to display an icon next to a text item in an single cell of a table view. An example of what I want to achieve is the application list in System Preferences -> User Accounts -> Login Items. What's a good way? ...

Core Data: To-Many Relationship ordered upon restart

When I restart my Core Data application with a to-many relationship my data (presented in NSTableView) is in random order. How do I keep it in that order in which the user left it before quitting the application? Of course, I can sort the data in awakeFromNib but that does not give me the precise order the user used to arrange the data ...

Populating NSTableview from a mutable array.

Hi, I've been attempting this for two days, and constantly running into dead ends. I've been through Aaron Hillegass's Cocoa Programming for MAC OS X, and done all the relevant exercises dealing with NSTableview and mutable arrays, and I have been attempting to modify them to suit my needs. However none of them seem to be using an ar...

NSTableView: Avoid Blue Header when Sorting Table Column

Hey experts, when I click on the header of an NSTableView column, the header gets blue and the little grey arrow shows up. How do I avoid the blue selection and the arrow (but keeping the sorting itself)? As an example for what I want: In Xcode click on the 'Groups & Files' header. Thank your for any help! ...

How do I replace a string with a string of unknown length?

I'm building a To-Do-List application which uses the following objects: NSTexField for data entry NSTableView to display the data (just string objects) NSButton that when clicked will add the contents of the NSTextField to the NSTableView for display. What I want to do is replace any given string in any row in the NSTableView with an...

Sectioned NSTable view with NSArrayController

Hello, I am trying to create a sectioned NSTableView using bindings with an NSArrayController or multiple NSArrayControllers. Basically the data container is an array within an array. Do I bind an NSArrayController to the parent collection and then bind another NSArrayController to a child collection? Is this the right approach? Thank...

What is clipRect in NSTableView?

Hello, I am trying to understand the meaning of clipRect in a table view embedded inside a scroll view. I assumed that the clip rect is the visible portion of the table view. This means that the width of the rect should not change as long as the table view is not resized, but upon monitoring the width of the clip rect in the following c...

NSOutlineView: Hot To Avoid Yellow Border When Dragging Items?

Hey experts, When I drag rows from an NSTableView to another NSOutlineView, the NSOutlineView gets a yellow highlighting border. How do I avoid that? To be precise, this happens only if I drag the rows from the table into the free space (i.e. not on any items) of the NSTableView. However, when I drag the rows directly on items in the N...

Get an image of NSTableView visible rect

I'm trying to find a way to get an NSImage (or CGImage or CIImage, I'm not picky) containing only the visible rect portion of an NSTableView. I've tried this: NSRect visiblePart = [someTable visibleRect]; NSImage *tableImage = [[NSImage alloc] initWithSize:tableFrame.size]; [tableImage lockFocus]; [someTable drawRect:visiblePart]; [ta...

Is it possible to design NSTableView cells using Interface Builder? (not for iOS apps)

Is it possible to design NSTableView cells using Interface Builder? I know this is actually possible if your project is for iOS but somehow IB does not render the cell container if its for Mac OS X. ...

Using NSPopUpButtonCell with NSTableView

Hello I am trying to use a NSPopUpButtonCell inside an NSTableView. Basically when you select an item in the pop up I want it displayed in the table view column/row. When an item in the popup cell is pressed I store it inside the data source using "tableView:setObject:forTableColumn:row", then when the table requests data I retrieve and ...

Showing serial nos. in a table column using NSArrayController and cocoa bindings

Hi all, I have a simple question: How to show serial nos. or (row no. + 1) in a table column using cocoa bindings and array controller? I have made an application using cocoa bindings and array controller, in which I am displaying names of certain persons in a table column. The class from which I am displaying is named as: Perso...

Deselecting NSTableView when clicked somewhere outside the table.

I have a NSTableView placed on top of NSView. I want to deselect the NSTableView when mouse pointer is clicked on NSView. How to achieve this? ...

NSTableView jumps on selection… why?

I've got an NSTableView with a single column, populated with NSTableViewDataSource methods (no bindings involved.) The NSTableView is inside an NSScrollView, as is the default behavior when you drag an NSTableView in from the library in Interface Builder. The contents of the tableview are populated based upon a search string that the use...

Hiding NSTableView header?

How do I hide an NSTableView header completely, so that it does not take any space up? ...

Can't create an NSImage?

Whenever I do: xxx = [NSImage imageNamed:@"Package.png"]; xxx loads but it's width and height remain 0. And whenever I try loading it into an NSImageCell I get this error: NSImageCell's object value must be an NSImage. Can someone help me out? I've never had this problem before. Edit: Sorry, I've missed this bit out. So when I ...

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: The view is going to display a number o...

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 name and an issued tax number. The secon...