2008 05 30Threaded Core Animation, Part Deux
Thanks to its threading, Core Animation graphically updates itself when calling
[CATransaction commit], even if we're in the middle of heavy work on the main thread. But how do you update standard NS* controls ?
[CATransaction commit], of course :) We'll work here with
NSProgressIndicator. First, setup CA for that control. :
[progress setWantsLayer:YES];. Then, in the middle of your heavy work :
[CATransaction begin]; [progress setDoubleValue:newValue]; // No refresh happens unless we change something, so dummy change opacity [[progress layer] setOpacity:1]; [CATransaction commit];
And you'll see your control update. It's pretty useless because the progress animates itself in the main thread's idle time and we're eating all of it, so there's no animation ! Just the progress … progressing.
And it doesn't seem to work on WebView.
- CocoaNav a Cocoa Class Browser using Core Animation
- Core Animation Starfield Core Animation sample using 3D layers
- Core Animation culling problems Don't setup a projection transform on the root layer !
- Threaded Core Animation while on the main thread, update your display with
- Core Animation Bindings binding Cocoa objects to
Core Animation Bindings.zip
- Core Animation Phantom Fade seeing ghosting ? Use two transaction to create and animate your objects
- Photoshop-like compositing with Core Animation