• 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: Appropriate -setWantsLayer: timing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appropriate -setWantsLayer: timing


  • Subject: Re: Appropriate -setWantsLayer: timing
  • From: Simon Wolf <email@hidden>
  • Date: Fri, 19 Feb 2010 22:17:39 +0000

On 19 Feb 2010, at 03:50, Scott Anguish wrote:

>
> On Feb 16, 2010, at 5:45 PM, Simon Wolf 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'.
>
>>
>> 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.
>>
>
> This is incorrect.
>
> If you want a layer-hosting view (rather than a layer-backed view) you must do this in the reverse order. setLayer: and then setWantsLayer:

Ah, that may explain some of the problems I was having!

Thanks Scott.

Simon Wolf

Website: http://www.ottersoftware.com
Twitter: http://www.twitter.com/sgaw
iChat: 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: 
 >Appropriate -setWantsLayer: timing (From: Keith Duncan <email@hidden>)
 >Re: Appropriate -setWantsLayer: timing (From: Simon Wolf <email@hidden>)
 >Re: Appropriate -setWantsLayer: timing (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: some advice on asynchronous control please
  • Next by Date: Re: some advice on asynchronous control please
  • Previous by thread: Re: Appropriate -setWantsLayer: timing
  • Next by thread: Re: Appropriate -setWantsLayer: timing
  • Index(es):
    • Date
    • Thread