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
Post a Comment