Re: String not showing up in Table
Re: String not showing up in Table
- Subject: Re: String not showing up in Table
- From: Philipp Ringli <email@hidden>
- Date: Thu, 3 Feb 2005 16:11:41 +0100
... forgot to add the lower two methods to my last email.
Here's the code again:
Controller.m:
----------------------------------------------------------------
-(NSDictionary *)createRecord
{
NSMutableDictionary *record = [NSMutableDictionary dictionary];
[record setObject:@"Please enter Classpath..." forKey:@"classpath"];
return record;
}
- (IBAction) addRecord:(id) sender
{
[classPathRecords addObject:[self createRecord]];
[classPathTable reloadData];
//NSLog (@"\nclassPathRecords:%@", classPathRecords);
}
-(void)awakeFromNib
{
classPathRecords = [[NSMutableArray alloc] init];
}
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
//NSLog (@"\naTableView:%@\ncount:%@", aTableView, [classPathRecords
count]);
return [classPathRecords count];
}
-(id)classPathTable:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
id theRecord, theValue;
NSLog (@"\naTableColumn identifier:%@", [aTableColumn identifier]);
theRecord = [classPathRecords objectAtIndex:rowIndex];
theValue = [theRecord objectForKey:[aTableColumn identifier]];
return theValue;
}
On 03.02.2005, at 10:52, Philipp Ringli wrote:
I am trying hard to get my table to work. ;-)
The table has two colums, one with a textfield, and one with a check
box.
Is this the right way to set the textfield in the table to "Please
enter Classpath..."?
(The user clicks the Add button and a new row is inserted, that he
then should edit.)
How do I go about adding the value for the check box column to the
dictionary (record)?
Right now, when I add a row using the Add button, a row is added, but
there's no "Please enter Classpath..." in the textfield.
And I can't check the check boxes.
Thanks,
Phil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden