Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Help with NSTableView

Help with NSTableView
Thread Tools
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status: Offline
Reply With Quote
Jan 5, 2001, 01:23 AM
 
Hello-
I'm trying to write a simple app that needs some sort of list view to display the contents of an array. I assume NSTableView is the route. However, i'm not sure how to implement it in Interface Builder. Any help would be appreciated! Thanks!

mike
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Pasadena, CA, USA
Status: Offline
Reply With Quote
Jan 5, 2001, 06:20 PM
 
I don't have PB or IB in front of me, so this is from memory - sorry if the details aren't quite right. My code style is Java; if you're doing things in Obj C the names are basically the same.

First, you'll need to add the Table to your interface. This is pretty straightforward in IB. Be sure that you set the label for each column in teh Attributes pane of the Inspector - you'll need it later. The table will get it's data from a DataSource object, which you can either define and link up in IB or you can define in PB and set it via NSTableView.setDataSource().

The datasource has methods that will be called to get the number of rows in the table, and the value for each column. You'll know which column you're in by the label you set in IB.

If you're writing your datasource in Java, I recommend that you make it extend NSObject, or you'll have problems with the Java2ObjC bridge.

That's pretty much all there is to it. There are a few apps out there that use the NSTableView - there's one in Java called Nicer, and another in Obj C called GIFFun.

Erik
     
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status: Offline
Reply With Quote
Jan 6, 2001, 01:04 AM
 
Thanks for replying! So, it happens that when i add what i believe to be a table to my interface, and look at in the Inspector the class is shown as being that of NSScrollView. Actually, i wasn't able to find any interface elements on the pallette that have the NSTableView class. Am i missing something, or is this behavior to be expected? Thank!

Mike

     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2