Showing a CAShapeLayer
I am trying to learn the CAShapeLayer.
I have gone through tutorials, and I created a simple program (OSX, not iOS) to try and create a CAShapelayer in a NSView.

This is in my view's intWithFrame:


      shape       = [CAShapeLayer layer];
      shape.frame = CGRectMake(50, 50, 200, 200);
      
      shape.backgroundColor = CGColorCreateGenericRGB(1.0f,0.0f,0.0f,1.0f);
      shape.borderWidth     = 3;
      shape.borderColor     = CGColorCreateGenericRGB(1.0f,1.0f,1.0f,1.0f);
      shape.shadowOffset    = CGSizeMake(0, 3);
      shape.shadowRadius    = 5.0;
      shape.shadowColor     = CGColorCreateGenericRGB(0.0f,0.0f,0.0f,1.0f);
      shape.shadowOpacity   = 0.8;
      
      shape.fillColor       = CGColorCreateGenericRGB(0.6f,0.4f,1.0f,1.0f);
      shape.fillRule        = kCAFillRuleNonZero;
      shape.lineCap         = kCALineCapRound;
      shape.lineDashPattern = nil;
      shape.lineDashPhase   = 0;
      shape.lineJoin        = kCALineJoinRound;
      shape.lineWidth       = 3;
      shape.miterLimit      = 10;
      shape.strokeColor     = CGColorCreateGenericRGB(0.4f,0.2f,0.8f,1.0f);
      shape.strokeStart     = 0.0;
      shape.strokeEnd       = 1.0;
      shape.path            = CGPathCreateWithEllipseInRect(shape.frame,NULL);
      
      [self.layer addSublayer:shape];
      [self.layer setNeedsDisplay];
      [shape setNeedsDisplay];



My window is being shown and my intWithFrame is being called.
Showing a CAShapeLayer
===

I am trying to learn the CAShapeLayer.
I have gone through tutorials, and I created a simple program (OSX, not iOS) to try and create a CAShapelayer in a NSView.

This is in my view's intWithFrame:


      shape       = [CAShapeLayer layer];
      shape.frame = CGRectMake(50, 50, 200, 200);
      
      shape.backgroundColor = CGColorCreateGenericRGB(1.0f,0.0f,0.0f,1.0f);
      shape.borderWidth     = 3;
      shape.borderColor     = CGColorCreateGenericRGB(1.0f,1.0f,1.0f,1.0f);
      shape.shadowOffset    = CGSizeMake(0, 3);
      shape.shadowRadius    = 5.0;
      shape.shadowColor     = CGColorCreateGenericRGB(0.0f,0.0f,0.0f,1.0f);
      shape.shadowOpacity   = 0.8;
      
      shape.fillColor       = CGColorCreateGenericRGB(0.6f,0.4f,1.0f,1.0f);
      shape.fillRule        = kCAFillRuleNonZero;
      shape.lineCap         = kCALineCapRound;
      shape.lineDashPattern = nil;
      shape.lineDashPhase   = 0;
      shape.lineJoin        = kCALineJoinRound;
      shape.lineWidth       = 3;
      shape.miterLimit      = 10;
      shape.strokeColor     = CGColorCreateGenericRGB(0.4f,0.2f,0.8f,1.0f);
      shape.strokeStart     = 0.0;
      shape.strokeEnd       = 1.0;
      shape.path            = CGPathCreateWithEllipseInRect(shape.frame,NULL);
      
      [self.layer addSublayer:shape];
      [self.layer setNeedsDisplay];
      [shape setNeedsDisplay];



My window is being shown and my intWithFrame is being called.