FROM : john darnell
DATE : Fri May 23 23:14:16 2008
Got it! Thank you!
John
-----Original Message-----
From: Shawn Erickson [mailto:<email_removed>]
Sent: Friday, May 23, 2008 3:38 PM
To: john darnell
Cc: <email_removed>
Subject: Re: NSTableView
On Fri, May 23, 2008 at 1:22 PM, john darnell
<john.<email_removed>> wrote:
> If I did have, say, three tables on a dialog, how would the code
know
> which function was for which table if that first element (or some
other
> element) is not differentiated?
An example of one way to do it follows...
@interface MyController : NSObject {
IBOutlet NSTableView* tableView1; // connected to table 1 in your
nib
IBOutlet NSTableView* tableView2; // connected to table 2 in your
nib
IBOutlet NSTableView* tableView3; // connected to table 3 in your
nib
}
@end
@implementation MyController
- (id) tableView:(NSTableView*)aTableView ...blah...
{
if (aTableView == tableView1) {
...
} else if (aTableView == tableView2) {
...
} else if (aTableView == tableView3) {
...
}
}
@end
DATE : Fri May 23 23:14:16 2008
Got it! Thank you!
John
-----Original Message-----
From: Shawn Erickson [mailto:<email_removed>]
Sent: Friday, May 23, 2008 3:38 PM
To: john darnell
Cc: <email_removed>
Subject: Re: NSTableView
On Fri, May 23, 2008 at 1:22 PM, john darnell
<john.<email_removed>> wrote:
> If I did have, say, three tables on a dialog, how would the code
know
> which function was for which table if that first element (or some
other
> element) is not differentiated?
An example of one way to do it follows...
@interface MyController : NSObject {
IBOutlet NSTableView* tableView1; // connected to table 1 in your
nib
IBOutlet NSTableView* tableView2; // connected to table 2 in your
nib
IBOutlet NSTableView* tableView3; // connected to table 3 in your
nib
}
@end
@implementation MyController
- (id) tableView:(NSTableView*)aTableView ...blah...
{
if (aTableView == tableView1) {
...
} else if (aTableView == tableView2) {
...
} else if (aTableView == tableView3) {
...
}
}
@end
| Related mails | Author | Date |
|---|---|---|
| john darnell | May 23, 22:03 | |
| David Wilson | May 23, 22:12 | |
| Erik Buck | May 23, 22:17 | |
| Brian Stern | May 23, 22:20 | |
| john darnell | May 23, 22:22 | |
| john darnell | May 23, 22:35 | |
| Andrew Farmer | May 23, 22:35 | |
| Shawn Erickson | May 23, 22:37 | |
| john darnell | May 23, 23:14 | |
| Lynn Barton | May 24, 02:22 | |
| john darnell | May 26, 16:38 |






Cocoa mail archive

