Simple TableView App (problem)
Simple TableView App (problem)
- Subject: Simple TableView App (problem)
- From: Thilo Ettelt <email@hidden>
- Date: Sun, 3 Feb 2002 19:07:06 +0100
Hi folks!
I'm experimenting with the TableView. The concept of a view and an
object is pretty complicated for me, but I want to get it work. So I
wrote a little app with a tableview, a textfield and a button, I
connected everything properly in the IB. The PB shows up no errors when
compiling, but the function, that should be provided by the app doesn't
work. It should simply add a row to the tableview...
Can anybody help me?
Cheers, Thilo
--
- (IBAction)addValue:(id)sender
{
[myArray addObject:[valueText stringValue]];
[myTableView reloadData];
}
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
return [[myArray objectAtIndex:rowIndex] objectForKey:[aTableColumn
identifier]];
}
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [myArray count];
}
- (id)init
{
self = [super init];
return self;
}
- (void)dealloc
{
[myArray release];
[super dealloc];
}
- (NSMutableArray *)myArray
{
return myArray;
}
--