The example code in the documentation has an error. The -setCompletionHandler:
method is an instance method, not a class method. You need to invoke it on [NSAnimationContext currentContext]
, not on the class itself:
[[NSAnimationContext currentContext] setCompletionHandler:^{
// This block will be invoked when all of the animations
// started below have completed or been cancelled.
NSLog(@"All done!");
}];