开发者

Why is the code not working?

开发者 https://www.devze.com 2023-02-03 05:27 出处:网络
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开发者_P

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开发者_Python百科
{
 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.


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

精彩评论

暂无评论...
验证码 换一张
取 消