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 > Accessing DataSource in two NSTableView's

Accessing DataSource in two NSTableView's
Thread Tools
Mac Elite
Join Date: Jul 2001
Location: Evansville, IN
Status: Offline
Reply With Quote
Jul 6, 2002, 12:31 AM
 
Can anyone point me to a source of information on connecting a datasource to two tableViews. My datasource contains an NSCalendarDate and an NSMutableArray. When a person clicks the date in the first tableView, I want the corresponding values for that date to show up in the second table.

All help appreciated.
Justin Williams
Chicks Really Dig Me
AIM - iTikki [NEW AND IMPROVED!]
http://www.tikkirulz.com
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 6, 2002, 03:40 AM
 
What information are you looking for? It doesn't seem to involve any trick, as far as I can tell. Most data source methods include a parameter (usually called aTableView) that tells you what tableview is calling them. Just put a conditional statement to check who's asking for data and provide the appropriate response. That should work for sharing a data source.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Senior User
Join Date: Jan 2002
Location: City of Beck's beer
Status: Offline
Reply With Quote
Jul 6, 2002, 05:36 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Justin W. Williams:
<strong>Can anyone point me to a source of information on connecting a datasource to two tableViews. My datasource contains an NSCalendarDate and an NSMutableArray. When a person clicks the date in the first tableView, I want the corresponding values for that date to show up in the second table.

All help appreciated.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">That's pretty simple. Just subclass NSObject in IB. Then instanciate it and make the connections. In the code you will have to find out which Tableview is asking for data and give it the correponding data (i.e. if tableview1 then see if which item of tv2 is selected and control the return data by that).

Cheers, Thilo
     
   
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 09:59 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