• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie: two tables on one window, how to talk to them?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: two tables on one window, how to talk to them?


  • Subject: Re: Newbie: two tables on one window, how to talk to them?
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 2 Sep 2002 19:09:08 +0200

On Monday, September 2, 2002, at 06:24 , Keith Pritchard wrote:

On Monday, September 2, 2002, at 04:59 PM, Tony S. Wu wrote:
- (int) numberOfRowsInTableView:(NSTableView *)aTableView
{
if (aTableView == myTableViewOutlet)
// do something
else if (aTableView == mySecondTableViewOutlet)
// do something else
}

Thanks! confirms what I was doing (except for the = rather than ==
typo... too much basic/delphi recently, not enough C.

There's another possible solution of course: you might make another data source/controller for the other table. Which one of the possible solution is better depends on the code: the simpler each controller and the more intimately they co-operate, the better the quoted solution. OTOH, the more complicated controller code and the more both tables are independent, the better is usage of different instances.

How does it work for notifications though?
I have
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{

NSTableView *tv=[aNotification object];
if (tv==myTableViewOutlet) ...

NSLog(@"Selected row %i, Group %@",[tableview1 selectedRow],[myArray
objectAtIndex:[tableview1 selectedRow]] );
}

---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Newbie: two tables on one window, how to talk to them? (From: Keith Pritchard <email@hidden>)

  • Prev by Date: AlertPanel after loading the app
  • Next by Date: Re: About TN 2053 and Cocoa
  • Previous by thread: Re: Newbie: two tables on one window, how to talk to them?
  • Next by thread: Re: Newbie: two tables on one window, how to talk to them?
  • Index(es):
    • Date
    • Thread