just a simple problem (I hope !)
I’ve got a void method which add a column to a table.
Why if I call that method programmatically (ex: [self method] ) my table won’t update and instead if i call it through an IBAction (pushing a button from app) it works ?
Actually i can see from the log that the method is called in both cases but update data just with IBAction.
the method:
- (IBAction)void {
NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:@"1"];
[column setWidth:50];
[tableData addTableColumn:column];
[tableData reloadData];
[[column headerCell] setStringValue:@"aColumn"];
NSLog(@"Method called"); //The method is called in both cases
}
I can’t find out what I am doing wrong.
(New to cocoa programming)
Thanks a lot !
Where did you call this programmatically? You might have called it before the view was loaded in an init method instead of something else like awakeFromNib.