Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Simplicated

macrumors 65816
Original poster
Sep 20, 2008
1,422
254
Waterloo, Ontario, Canada
Hi, for some reason it seems my NSTableView is not really working. It crashes the app and gives the following messages in Console
Code:
2009-01-10 17:26:05.017 MyApp[28858:10b] *** -[NSCFArray rowIndex]: unrecognized selector sent to instance 0x10803b0
2009-01-10 17:26:05.018 MyApp[28858:10b] *** -[NSCFArray rowIndex]: unrecognized selector sent to instance 0x10803b0
2009-01-10 17:26:06.856 MyApp[28858:10b] *** -[NSCFArray rowIndex]: unrecognized selector sent to instance 0x10803b0
2009-01-10 17:26:06.859 MyApp[28858:10b] *** -[NSCFArray rowIndex]: unrecognized selector sent to instance 0x10803b0

Part of the code:
Code:
-(int)numberOfRowsInTableView:(NSTableView *)aTable {
	return [candidates count];
}

-(id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
row:(int)rowIndex; {
	return [candidates rowIndex];
}

Where candidates is a "global" NSArray.

Please help me. Thank you.
 
try this rewriting the method similar to this.
Code:
- (id)tableView:(NSTableView *)tv 
objectValueForTableColumn:(NSTableColumn *)tableColumn 
			row:(int)row 
{ 
    NSString *v = [candidate objectAtIndex:row]; 
    return v; 
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.