Question regarding NSTableView
Question regarding NSTableView
- Subject: Question regarding NSTableView
- From: Philipp Ringli <email@hidden>
- Date: Wed, 2 Feb 2005 22:44:56 +0100
I getting this error message:
[Session started at 2005-02-02 22:26:06 +0100.]
2005-02-02 22:26:08.472 MTASC-X[1650] *** Illegal NSTableView data
source (<Controller: 0x353110>). Must implement
numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:
I have connected the NSViewTable in IB.
Class Controller has these Attributes:
Outlets:
Outletname: classPathTable Type: id (couldn't this be NSTableView?)
Actions:
addRecord:
saveRecords:
deleteRecords:
In NSTableView Info Panel I have an outlet DataSource -> Controller
In Controller (Custom) Info Panel I have an outlet classPathTable ->
NSTableView(Classpath, Active)
These are excerpts of code from the respective files:
in my Controller.h:
------------------------------------------------
NSMutableArray *classPathRecords; // an array holding dictionary Objects
IBOutlet id classPathTable; // Ref to View: NSTableView (NIB)
- (IBAction)addRecord:(id)sender;
- (IBAction)saveRecords:(id)sender;
- (IBAction)deleteRecords:(id)sender;
in my Controller.m:
------------------------------------------------
// Handling Classpath Table
-(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 (@"\nclassPathTable:%@", classPathTable);
}
- (IBAction) deleteRecords:(id) sender
{
}
- (IBAction) saveRecords:(id) sender
{
}
-(void)awakeFromNib
{
classPathRecords = [[NSMutableArray alloc] init];
}
-------------------------------------------------
I am *very* new to cocoa, and objective-c. (...you might have already
noticed. ;-) )
Any tip is welcome.
Thanks for reading,
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