Comments on: Two small iOS tricks Brad, Thanks for sharing your solutions. I like the idea of spending time trying crazy stuff in anticipation of WWDC. I'm already creating a list of everything I encounter that I'd like to ask next year. Brad,

Thanks for sharing your solutions. I like the idea of spending time trying crazy stuff in anticipation of WWDC. I’m already creating a list of everything I encounter that I’d like to ask next year.

]]>
By: Brad Larson/2011/06/25/two-small-ios-tricks/#comment-6336 Brad Larson Sun, 26 Jun 2011 00:00:44 +0000 [NSNull null], @"frame",
[NSNull null], @"position",
nil];
layer.actions = newActions;
[newActions release];

I don’t know that I’d call disabling animations using a transaction “very obscure”, since I know many people that use this quite regularly. In fact, it’s one of the topics I covered in the class I taught on Core Animation which is available on iTunes U. I also highly recommend Marcus Zarra and Matt Long’s book on the subject, and they talk about various ways of tweaking implicit animations that include the above.

More obscure features of Core Animation would be things like setting the m34 property of a CATransform3D to a negative small fraction to provide a perspective effect for your layers, or how to log the complete layer hierarchy out on the GDB command line using an undocumented method, the latter I have since forgotten because I didn’t write it down.

Like you, I picked these up in the labs, which are invaluable for solving intricate problems. I tend to spend the months prior to WWDC trying out crazy ideas, just so I can accumulate a list of questions to ask in the labs. With what I learned this year from spending time with the engineers, I’m easily months ahead of schedule. That by itself pays for the cost of the conference.

In regards to your second case, I’d do what I could to eliminate the main thread executions from your time-consuming method as a longer-term solution to your issue. You’ll definitely see better performance by doing so on a multicore system like the iPad 2, and you’ll eliminate that nasty polling loop that you have manually advancing the main run loop. Also, I’d be worried that even though you don’t hit a deadlock in your testing, it might be simply infrequent enough that one of your customers would hit it at some point in the field.

]]>