• 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: Multiple NSTableView question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple NSTableView question


  • Subject: Re: Multiple NSTableView question
  • From: Brian Webster <email@hidden>
  • Date: Thu, 21 Jun 2001 13:02:21 -0500

On Thursday, June 21, 2001, at 03:50 AM, cocoa-dev-
email@hidden wrote:

I keep reading that by evaluating the theTableView argument used in

- (int)numberOfRowsInTableView:(NSTable *)theTableView

and

- (id)tableView:(NSTableView *)theTableView
objectValueForTableColumn:(NSTableColumn *)theColumn
row:(int)rowIndex


you can distinguish which table view is invoking these methods, when
using more than one table view.

My question is this: Evaluate it against what?

Just compare the pointer values like so:

@interface MyTableDelegate : NSObject
{
IBOutlet NSTableView *table1, *table2;
}

@end

@implementation MyTableDelegate

-(int)numberOfRowsInTableView:(NSTableView*)theTableView
{
if(theTableView == table1)
//return number of rows for table 1
else if(theTableView == table2)
//return number of rows for table 2
}

@end

--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster


  • Prev by Date: RE: Cocoa/EOF for non-enterprise apps
  • Next by Date: Re: WWDC Dev Tools / Software update
  • Previous by thread: Re: Multiple NSTableView question
  • Next by thread: RE: Multiple NSTableView Question
  • Index(es):
    • Date
    • Thread