This is probably a simple question but I can\'t seem to figure out how to do it. Basically all I want to do is fade a window before closing it:
[[window anim
This is an old (but still popular) question with obsolete answer.
The right way to wait for animator finished is using special NSAnimationContext's class method with completionHanler like this:
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
// Start some animations here.
[[window animator] setAlphaValue:0.0];
} completionHandler:^{
// This block will be invoked when all of the animations started above have completed or been cancelled.
NSLog(@"All done!");
}];