views:

30

answers:

1

I have this code:

- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
{
    if ([[tableColumn identifier] isEqualToString:@"friend name"]) {
        if (row == 0) {
            return @"All friends";
        } else {
            return [[friendsArray objectAtIndex:row - 1] name];
        }
    }

    return nil;
}

And I get this warning, although the program runs as expected:

conflicting types for '-(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row'

How can I get rid of this warning? Thanks.


Answers related to UITableViews instead of NSTableViews will be down voted.

+1  A: 

In 10.5, the definition of this was changed to:

- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;

Note the use of NSInteger versus int.

Rob Napier
I see. Thanks :D
Time Machine