objective c - iOS: NSNotification unrecognized selector error -


nsnotification *notification = [nsnotification notificationwithname:@"locationobtained" object:self]; [[nsnotificationcenter defaultcenter]postnotification:notification]; 

i [locavoreretrofirstviewcontroller startservices]: unrecognized selector sent instance 0x74c3070

- (void)listenforlocationcompletion{     [[nsnotificationcenter defaultcenter]addobserver:self                                             selector:@selector(startservices)                                                 name:@"locationobtained"                                               object:nil]; }  - (void)startservices:(nsnotification *)notification{  } 

any reason why error?

change :

[[nsnotificationcenter defaultcenter]addobserver:self                                             selector:@selector(startservices:)                                                 name:@"locationobtained"                                               object:nil]; } 

your selector startservices missed ":" @ end


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -