i have an NSNotificationCenter selector,
where to put it ? in the delegate (if yes then where?) in the controller?
where to put the method as well.
do i need to dealloc the NSNotificationCenter ?
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceNotificationReceived:) name:UIApplicationDidBecomeActiveNotification object:nil];
- (void)deviceNotificationReceived:(NSNotification *)notification
{
[self.soundMgr endInterruption];
}
The
deviceNotificationReceived:method must be an instance method of the argument toaddObserver:. It isselfin this instance, so your method should go in the same class.You should not release the NotificationCenter, as you did not create or retain it.
Your question was a little hard to understand, is this what you were asking?