views:

14

answers:

0

Heya folks.

Im wondering how I send the NSWindow object of the main window to a class that will do something with it. The main idea is that I press a button and then something happens to the window. (A NSAnimation for instance).

fader = [[Fader alloc] initWithWindow:window];

Thats what sends the 'window' var to my Fader Class

-(id)initWithWindow:(NSWindow *)window {
    currentWindow = window;
    self = [super init];
    if(self) {
        [self initFadeIn];
        [self initFadeOut];
    }

is what catches it. But, this is where it goes wrong. I declared my currentWindow as follows:

NSWindow *currentWindow;

So, whenever i run this code i get the following error:

2

010-08-20 17:03:46.302 Sandbox[7785:a0f] -[NSAnimation initWithViewAnimations:]: unrecognized selector sent to instance 0x100144e30

2010-08-20 17:03:46.305 Sandbox[7785:a0f] -[NSAnimation initWithViewAnimations:]: unrecognized selector sent to instance 0x100144e30

So, what to do now? :O How can i save the window var in my Fader class?