views:

115

answers:

1

Here's my code:

- (IBAction)showTaskDetailView:(id)sender {
    [window setContentView:viewTaskView];
}

How would I fade out the current view and fade in the detail view?

+1  A: 

Don't change the content view; put both views in the same content view, and use NSViewAnimation to fade one out and the other in.

Peter Hosey
Could you provide a code example?
nanochrome
The documentation should be all you need. You'll init the animation with two dictionaries: One has its target set to the view to fade out, and the effect set to fade it out; the other has its target set to the view to fade in, and the effect set to fade it in. Don't forget to look in the superclass, NSAnimation, for more methods (e.g., to set the animation's duration).
Peter Hosey