Create dashed line in SpriteKit (OS X)

I'm trying to create a dashed line using an SKShapeNode in SpriteKit for Mac OS X in Objective C, not iOS and not in Swift. I've taken a look at many SO articles for this and tried to piece it together. The main issue that a lot of them are in Swift. Here's what I've come up with so far, but it's not showing anything and I'm not sure why:

-(void) drawBarLineDivisions {
    ...
    NSBezierPath *path = [NSBezierPath bezierPath];
    CGPoint startPoint = CGPointMake(0, 250);
    CGPoint endPoint = CGPointMake(450, 250);
    [path moveToPoint:startPoint];
    [path lineToPoint:endPoint];
    CGFloat pattern[2] = {10.0, 10.0};

    CGPathRef dashedLine = CGPathCreateCopyByDashingPath ([self CGPathFromPath:path], nil, 0, pattern, 2);
    SKShapeNode *line = [SKShapeNode shapeNodeWithPath:dashedLine];

    CGPathRelease(dashedLine);

    int x = i/(double)measureDivisions*[self getGridArea]/[self getMeasuresDisplayed];

    [line setPosition:CGPointMake(x, 0)];
    [line setFillColor:fillColor];
    [line setStrokeColor:[NSColor clearColor]];
    [self addChild:line];
}

//helper method for converting NSBezierPath into CGPath
- (CGMutablePathRef)CGPathFromPath:(NSBezierPath *)path
{
    CGMutablePathRef cgPath = CGPathCreateMutable();
    NSInteger n = [path elementCount];

    for (NSInteger i = 0; i < n; i++) {
        NSPoint ps[3];
        switch ([path elementAtIndex:i associatedPoints:ps]) {
            case NSMoveToBezierPathElement: {
                CGPathMoveToPoint(cgPath, NULL, ps[0].x, ps[0].y);
                break;
            }
            case NSLineToBezierPathElement: {
                CGPathAddLineToPoint(cgPath, NULL, ps[0].x, ps[0].y);
                break;
            }
            case NSCurveToBezierPathElement: {
                CGPathAddCurveToPoint(cgPath, NULL, ps[0].x, ps[0].y, ps[1].x, ps[1].y, ps[2].x, ps[2].y);
                break;
            }
            case NSClosePathBezierPathElement: {
                CGPathCloseSubpath(cgPath);
                break;
            }
            default: NSAssert(0, @"Invalid NSBezierPathElement");
        }
    }
    return cgPath;
}