Repository: realm/realm-swift
File: src/tightdb/objc/cursor_objc.mm (Objective-C++)

Code before:
-(TightdbBinary *)getBinaryInColumn:(NSUInteger)colNdx
{
    return [_table getBinaryInColumn:colNdx atRow:_ndx];
}

-(BOOL)getBoolInColumn:(NSUInteger)colNdx
{
    return [_table getBoolInColumn:colNdx atRow:_ndx];
}

-(float)getFloatInColumn:(NSUInteger)colNdx
{
    return [_table getFloatInColumn:colNdx atRow:_ndx];
}

-(double)getDoubleInColumn:(NSUInteger)colNdx
{
    return [_table getDoubleInColumn:colNdx atRow:_ndx];
}

-(time_t)getDateInColumn:(NSUInteger)colNdx
{
    return [_table getDateInColumn:colNdx atRow:_ndx];
}

-(TightdbTable *)getTableInColumn:(NSUInteger)colNdx
{
    return [_table getTableInColumn:colNdx atRow:_ndx];
}

-(TightdbMixed *)getMixedInColumn:(NSUInteger)colNdx
{
    return [_table getMixedInColumn:colNdx atRow:_ndx];
}

-(void)setInt:(int64_t)value inColumn:(NSUInteger)colNdx
{
    [_table setInt:value inColumn:colNdx atRow:_ndx];
}

-(void)setString:(NSString *)value inColumn:(NSUInteger)colNdx
{
    [_table setString:value inColumn:colNdx atRow:_ndx];
}

-(void)setBinary:(TightdbBinary *)value inColumn:(NSUInteger)colNdx
{
    [_table setBinary:value inColumn:colNdx atRow:_ndx];
}

-(void)setBool:(BOOL)value inColumn:(NSUInteger)colNdx

Review comment (suggestion):
You can probably use `verify_cell`which is found in my object literal branch.


Code after:
        case tightdb_Double:
            return [NSNumber numberWithLongLong:[_table getDoubleInColumn:colNdx atRow:_ndx]];
        case tightdb_String:
            return [_table getStringInColumn:colNdx atRow:_ndx];
        case tightdb_Date:
            return [NSDate dateWithTimeIntervalSince1970:[_table getDateInColumn:colNdx atRow:_ndx]];
        case tightdb_Binary:
            return [_table getBinaryInColumn:colNdx atRow:_ndx];
        case tightdb_Table:
            return [_table getTableInColumn:colNdx atRow:_ndx];
        case tightdb_Mixed:
            return [_table getMixedInColumn:colNdx atRow:_ndx];
    }
}

- (id)objectForKeyedSubscript:(id <NSCopying>)key
{
    NSUInteger colNdx = [_table getColumnIndex:(NSString*)key];
    return [self objectAtIndexedSubscript:colNdx];
}

-(void)setObject:(id)obj atIndexedSubscript:(NSUInteger)colNdx
{
    TightdbType columnType = [_table getColumnType:colNdx];

    // TODO: Verify obj type

    switch (columnType) {
        case tightdb_Bool:
            [_table setBool:[obj boolValue] inColumn:colNdx atRow:_ndx];
            break;
        case tightdb_Int:
            [_table setInt:[obj longLongValue] inColumn:colNdx atRow:_ndx];
            break;
        case tightdb_Float:
            [_table setFloat:[obj floatValue] inColumn:colNdx atRow:_ndx];
            break;
        case tightdb_Double:
            [_table setDouble:[obj doubleValue] inColumn:colNdx atRow:_ndx];
            break;
        case tightdb_String:
            if (![obj isKindOfClass:[NSString class]])
                [NSException raise:@"TypeException" format:@"Inserting non-string obj into string column"];
            [_table setString:(NSString*)obj inColumn:colNdx atRow:_ndx];
            break;
        case tightdb_Date:
            if ([obj isKindOfClass:[NSDate class]])
                [NSException raise:@"TypeException" format:@"Inserting non-date obj into date column"];
            [_table setDate:time_t([obj timeIntervalSince1970]) inColumn:colNdx atRow:_ndx];
            break;
        case tightdb_Binary: