Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer - delegate not being called?



Hi Neil,

you have to tell the layer it needs a display, it does not know that by its self.

HTH,

-bd-
http://bill.dudney.net/roller/objc

On Nov 27, 2007, at 3:39 PM, Neil Clayton wrote:

Hi All!

I'm playing around with CoreAnim, and having trouble getting delegates working. I figure I must be doing something very very wrong here.

in awakeFromNib, of an NSView that is visible:

	CALayer *main = [self setupLayer];
	self.layer = main;
	self.wantsLayer = YES;

This shows OK - as in I get a white border around the layer in my view - since that's what I've setup in setupLayer.


- (CALayer*) setupLayer { CALayer *layer = [CALayer layer]; [layer setDelegate:[[[SimpleDelegate alloc] init] retain]];

	// Set the white border so I can tell the layer is there
	[self setupBasicLayerProperties:layer];
	return layer;
}

My delegate (SimpleDelegate) does this:
- (void)drawLayer:(CALayer *)layer inContext: (CGContextRef)theContext {
NSLog(@"go");
....
...
...
}


But I never see a "go" in console - it's never called.
I'm clearly missing something here - anyone got any pointers on getting delegates/CALayer working as expected?


--
Regards,
Neil Clayton






_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >CALayer - delegate not being called? (From: Neil Clayton <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.