I'm trying to get a CALayer with a black background to display. I've attached the AppDelegate as the delegate to the file's owner. The console reports correctly the "awaking from nib..." log statement. I however, just see a blank grey window (335x390 in size), with no black box drawn in the middle. What concept am I missing?
Thanks in advance for the help,
Charles
#import "AppDelegate.h"
#import <QuartzCore/QuartzCore.h>
@implementation AppDelegate
-(void)awakeFromNib;
{
NSLog(@"awaking from nib...");
[[window contentView] setWantsLayer:YES];
layer = [CALayer layer];
[layer setBounds:CGRectMake(0.0,0.0,100.0,100.0)];
// center the animation layer
[layer setPosition:CGPointMake([[window contentView] frame].size.width/2, [[window contentView]frame].size.height/2)];
CGColorRef color = CGColorCreateGenericRGB(0., 0., 0., 1);
[layer setBackgroundColor:color];
CFRelease(color);
[layer setBorderWidth:5.0f];
[[[window contentView] layer] addSublayer:layer];
}
@end