Lefora Free Forum
Loading
930 views

Problems with NSTableView and reloadData

Page 1
1–3
rookie - member
2 posts

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

?
288 posts

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.

__________________
rookie - member
2 posts

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.

Page 1
1–3

Locked Topic


You must be a member to post in this forum

Join Now!