# DEFINE _ uikeyboardframeenduserinfokey (& uikeyboardframeenduserinfokey! = NULL? Uikeyboardframeenduserinfokey :@"Uikeyboardboundsuserinfokey")
Add the notification observer and event during viewwillappear.
[[Nsicationcenter center defacenter center] addobserver: Self selector: @ selector (keyboardwillshow :) name: jsonobject: Nil]; [[nsicationicationcenter defacenter center] addobserver: Self selector: @ selector (handler :) name: uikeyboardwillhidenotification object: Nil];
-(Void) viewwilldisappear :( bool) animated {[[nsicationicationcenter defacenter center] removeobserver: Self];}
Remove the observer during willdisappear.
Here we will handle the processing you want to do, such as the keyboard blocking your login box or other.
-(Void) keyboardwillshow :( nsnotification *) Notification {// _ keyboardrect = [[[Notification userinfo] objectforkey: _ blank] cgrectvalue];}-(void) keyboardwillhide :( nsnotification *) notification {// _ keyboardrect = [[[Notification userinfo] objectforkey: _ uikeyboardframeenduserinfokey] cgrectvalue];}