0
votes

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.

1

1 Answers

4
votes

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;
}