la notificación de iphone da como resultado "un selector no reconocido enviado a la instancia ..."
Para abreviar, estoy registrando lo siguienteNSNotification
oyente enClassA
(enviewDidLoad
):
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playSong) name:@"playNotification" object:nil];
Tengo el selector declarado enClassA.h
:
- (void)playSong:(NSNotification *) notification;
Y la implementación es la siguiente:
- (void)playSong:(NSNotification *) notification {
NSString *theTitle = [notification object];
NSLog(@"Play stuff", theTitle);
}
EnClassB
(en eltableView:didSelectRowAtIndexPath:
método) tengo:
NSInteger row = [indexPath row];
NSString *stuff = [playlistArray objectAtIndex:row];
[[NSNotificationCenter defaultCenter] postNotificationName:@"playNotification" object:stuff];
Todo termina con un mensaje de error que dice:
"selector no reconocido enviado a la instancia"
antes deplaySong
Se invoca el método.
¿Alguien puede ayudarme aquí? ¿Qué olvido al publicar una notificación de un controlador a otro?