What is the right way to do this? Here is what I am trying. But display is never called on dotLayer:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
DotLayer *dotLayer = [[DotLayer alloc]init ];
dotLayer.frame= CGRectMake(10, 10, 100, 100);
dotLayer.nDots = 4;
NSView *contentView = window.contentView;
CALayer *layer = [[CALayer alloc]init];
layer.frame = CGRectMake(0,0,200,200);
contentView.layer = layer;
[layer addSublayer:dotLayer];
[dotLayer setNeedsDisplay];
}
DotLayer is a CALayer subclass.
Did you forget to setWantsLayer maybe?
contentView.wantsLayer = true
That is often the problem!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With