0

私は Xcode5 に基づいて NSTableView (セル ベース) アプリを開発しており、行の高さを決定するために各 NSTextFieldCell のセルを取得したいと考えています。これはこれまでの私のコードです

- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row{

    if (tableView == _tableView) {

        NSTableColumn *column = [_tableView tableColumnWithIdentifier:@"Consecutivo"];
        NSTextFieldCell *cell = [column dataCellForRow:row];



        NSInteger occurences = [Functions FindOccurencesOfText:@"\n"
                                              inWholeText:cell.stringValue];

        if (occurences > 0) { return occurences * 17; }
        else { return 17; }

    }
    else                         { return 17; }
}

しかし、文字列のセル値を取得できません

入れても

NSLog(@"text: %@", cell.stringValue); 

私が得るのは

text: 

私が感謝する助け

4

0 に答える 0