Reputation: 9392
Here's a part of my code for one of my table view delegate. Here's the code
-(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { if ([tableColumn isEqual:nameTableColumn] == YES) { NSMutableArray *rowArray = [theList objectAtIndex:row]; return [rowArray objectAtIndex:0]; } else if ([tableColumn isEqual:raiseTableColumn] == YES) { NSMutableArray *rowArray = [theList objectAtIndex:row]; return [rowArray objectAtIndex:1]; } }
Yet when I compile it, it has a end of non-void function error. From my level of experience (which is not a lot), it's suppose to work, but it's not.
Upvotes: 1
Views: 168
Reputation: 1394
You need a final else
-statement for those cases where none of the previous conditions are satisfied. In other words, something like:
else {
return nil;
}
Upvotes: 4