Problems with NSTableView and reloadData
Hi, i am using the following code, however, i am not sure how to properly call the reload data function..
#import "controller1.h"
@implementation controller1
- (IBAction)convert:(id)sender {
[tableView reloadData]];
// tableView undeclared is the error...
}
- (int)numberOfRowsInTableView:(NSTableView *)tableView
{
return [myData count];
}
- (id)tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
row:(int)row
{
return [myData objectAtIndex:row];
}
@end
Well, your code looks OK to me (apart from the ]] which should be ]). I wrote a little example of this last week for another reader: http://www.cocoaforum.com/2010/05/07/how-do-i-set-a-day-value-to-a-nsmatrix-cell-to-lin/#post9
If you're still puzzled, delete your build directory, zip and send me your code and I'll fix it for you.
Hi Clanmills, thanks a lot for your response, i found the problem however, I didn't realize that i had to hook up an outlet as well as the Data source.
Thanks for the help.