I've a class called AppController.h/m I want to make something when the NSNotificationDidResignActiveNotification is sent. So i wrote this code in AppController.m:
-(void) initialize(){
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidResignActive:)
name:NSApplicationDidResignActiveNotification
object:nil ];
}
and then
-(void) applicationDidResignActive (NSNotification*) note{
NSBeep();
}
The problem is that the method isn't executed and i get this in the Console:
+[AppController applicationDidResignActive:]: unrecognized selector sent to class 0x61c4
I can't get where the problem is: could you help me?
Thank you!
AppController.h/m
, you have a class calledAppController
with a header fileAppController.h
and an implementation fileAppController.m
. Hrumph." – Designed