ios - NSNotificationCentre Crash -


in application listen keyboard notifications:

  [[nsnotificationcenter defaultcenter] addobserver:self                                          selector:@selector(keyboardwillshow)                                              name:uikeyboardwillshownotification                                            object:nil]; 

i have removed bug caused crash in app,

i have modal view ui (which gets destroyed , recreated each time it's presented.

i getting crash second time went use before added line of code:

[[nsnotificationcenter defaultcenter] removeobserver:self]; 

any 1 know why not removing observer dealloced object caused crash?

this because when notification, if havent removed class observer, still tries calling method. however, since object has been deallocated , destroyed, exc_bad_access.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -