• 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: Core Animation animations stop prematurely at random
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Animation animations stop prematurely at random


  • Subject: Re: Core Animation animations stop prematurely at random
  • From: Bill Cheeseman <email@hidden>
  • Date: Tue, 17 May 2011 14:35:50 -0400

On May 17, 2011, at 12:58 PM, David Duncan wrote:

> The basic problem comes about when a view in the nib has wantsLayer=NO, but the view itself always wants to be layer backed. If you setWantsLayer:YES inside of -initWithFrame:, then by the time you get to -awakeFromNib wantsLayer=NO again. As such, if you did anything that relied on the view being layer backed (such as setting its layer and manipulating the layer tree) then that work needs to be done again.

I get it. Thanks.

> However, this should not apply to any layers you create that aren't implanted into the view. You should be able to create layers to your hearts content inside of -initWithFrame: as long as you don't try to manipulate the view's layer tree. As such your statement that you couldn't create layers there seems to be indicative of some other issue.


I agree that the explanation doesn't logically lead to a prohibition on creating layers in -initWithFrame:. That's why I initially created them there, deferring only the construction of the layer tree to -awakeFromNib. But I suffered random failures -- in fact, the application failed more often than not. The randomness is consistent with my doing something to which the phrase "undefined behavior" is often applied in Apple documentation. Now that I've moved the layer creation to -awakeFromNib, however, my application is working correctly 100% of the time.

100% of past time, that is. As to future time, I don't know yet.  ;->  That's the trouble with random failures....

--

Bill Cheeseman - 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

  • Follow-Ups:
    • Re: Core Animation animations stop prematurely at random
      • From: Kyle Sluder <email@hidden>
References: 
 >Core Animation animations stop prematurely at random (From: Bill Cheeseman <email@hidden>)
 >Re: Core Animation animations stop prematurely at random (From: Bill Cheeseman <email@hidden>)
 >Re: Core Animation animations stop prematurely at random (From: David Duncan <email@hidden>)
 >Re: Core Animation animations stop prematurely at random (From: Bill Cheeseman <email@hidden>)
 >Re: Core Animation animations stop prematurely at random (From: David Duncan <email@hidden>)

  • Prev by Date: Re: Creating an iPad-specific xib in IB
  • Next by Date: Re: Core Animation animations stop prematurely at random
  • Previous by thread: Re: Core Animation animations stop prematurely at random
  • Next by thread: Re: Core Animation animations stop prematurely at random
  • Index(es):
    • Date
    • Thread