RE: NSTableView
RE: NSTableView
- Subject: RE: NSTableView
- From: ".::welemski::." <email@hidden>
- Date: Tue, 6 Sep 2005 15:10:36 +0800
tried already but it seems i can't get the code to work.
What I did is that I put an identifier string from the "NSTableColumn"
inspector in the Attributes. My identifiers are "lname","fname".
here is my save action method
- (IBAction)aSave:(id)sender
{
NSString *fname, *lname;
NSMutableDictionary *thisDictionary=[NSMutableDictionary new];
fname=[outletFname stringValue];
lname=[outletLname stringValue];
[thisDictionary setObject:fname forKey: @ "lname"];
[thisDictionary setObject:lname forKey: @ "fname"];
[myArray addObject:thisDictionary]; //myArray is already declared
globally and is being constructed in the -(void)awakeFromNib{} method;
}
Look at my code below and see what's wrong with it... why it can't
still display all the lists
-(int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [myArray count];
}
-(id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)row
{
id thisRecord, thisValue; //i also tried this -> NSDictionary thisRecord
thisRecord=[myArray objectAtIndex:row];
thisValue=[thisRecord objectForKey:[aTableColumn identifier]];
return thisValue;
}
--
-- -- -- -- -- -- -- -- -- -- --
welemski
-- -- -- -- -- -- --
_______________________________________________
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