Re: Appropriate -setWantsLayer: timing
Re: Appropriate -setWantsLayer: timing
- Subject: Re: Appropriate -setWantsLayer: timing
- From: Simon Wolf <email@hidden>
- Date: Tue, 16 Feb 2010 22:45:32 +0000
Hi Keith,
In addition to David's reply, a small tip is that you can also get things working if you call setWantsLayer: and then follow it by assigning a layer:
[self setWantsLayer:YES];
[self setLayer:[CALayer layer]];
Otherwise the layer is added at some undetermined future point which may not (in my experience ever) be in the current run loop.
Simon Wolf
Website: http://www.ottersoftware.com
Twitter: http://www.twitter.com/sgaw
On 16 Feb 2010, at 20:52, Keith Duncan wrote:
> I'm wondering when writing a layer hosting view, when the most appropriate time is to set the layer and call -setWantsLayer:YES?
>
> Calling it in -initWithFrame: is too early and the view fails to 'draw'.
>
> Keith
> _______________________________________________
>
> 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