My guess is the system doesn't actually start the animation that removes the open panel until later in the run loop, after startProcess:
returns. So if your “some other method calls here
” takes a long time to run, it will take a long time before the animation starts.
The ideal solution is to perform your slow “other method calls” on a background queue, because you should try to avoid blocking the main thread. But that might require you to make various things thread-safe that currently aren't, which could be hard.
A different approach is just to put off doing them until later in the run loop:
- (IBAction)startProcess:(id)sender {
NSString *path = [Document openVideoFile]; // open file
dispatch_async(dispatch_get_main_queue(), ^{
// some other method calls here
});
}
or you might need to put it off slightly longer than that:
- (IBAction)startProcess:(id)sender {
NSString *path = [Document openVideoFile]; // open file
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC / 100), dispatch_get_main_queue(), ^(void){
// some other method calls here
});
}