• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CALayer - delegate not being called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer - delegate not being called?


  • Subject: Re: CALayer - delegate not being called?
  • From: Bill Dudney <email@hidden>
  • Date: Wed, 28 Nov 2007 04:48:03 -0700

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:
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:
This email sent to email@hidden


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

  • Prev by Date: Storing NSColor & NSData objects in an XML document
  • Next by Date: Re: Custom-view cursor changing
  • Previous by thread: Re: CALayer - delegate not being called?
  • Next by thread: Is there a "select folder" panel?
  • Index(es):
    • Date
    • Thread