 defaultCenter] addObserver:self
                                             selector:@selector(editingDidBegin:)
                                                 name:UITextFieldTextDidBeginEditingNotification
                                               object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(editingDidBegin:)
                                                 name:UITextViewTextDidBeginEditingNotification
                                               object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(editingDidEnd:)
                                                 name:UITextFieldTextDidEndEditingNotification
                                               object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(editingDidEnd:)
                                                 name:UITextViewTextDidEndEditingNotification
                                               object:nil];
}

- (void)viewDidUnload {
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UITextFieldTextDidBeginEditingNotification
                                                  object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UITextViewTextDidBeginEditingNotification
                                                  object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UITextFieldTextDidEndEditingNotification
                                                  object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UITextViewTextDidEndEditingNotification
                                                  object:nil];
    self.targetTextInput = nil;

    [super viewDidUnload];
}

#pragma mark - editingDidBegin/End

// Editing just began, store a reference to the object that just became the firstResponder
- (void)editingDidBegin:(NSNotification *)notification {
    if (![notification.object conformsToProtocol:@protocol(UITextInput)]) {
        self.targetTextInput = nil;
        return;
    }

    self.targetTextInput = notification.object;
}

// Editing just ended.
- (void)editingDidEnd:(NSNotification *)notification {
    self.targetTextInput = nil;
}

#pragma mark - Keypad IBAction's

// A number
defaultCenter ] addObserver: self 
                                              selector:@selector(editingDidBegin :) 
                                                  name: UITextFieldTextDidBeginEditingNotification 
                                                object: nil ]; 
     [ [ NSNotificationCenter defaultCenter ] addObserver: self 
                                              selector:@selector(editingDidBegin :) 
                                                  name: UITextViewTextDidBeginEditingNotification 
                                                object: nil ]; 
     [ [ NSNotificationCenter defaultCenter ] addObserver: self 
                                              selector:@selector(editingDidEnd :) 
                                                  name: UITextFieldTextDidEndEditingNotification 
                                                object: nil ]; 
     [ [ NSNotificationCenter defaultCenter ] addObserver: self 
                                              selector:@selector(editingDidEnd :) 
                                                  name: UITextViewTextDidEndEditingNotification 
                                                object: nothing ]; 
 } 

 - (void)viewDidUnload { 
     [ [ NSNotificationCenter defaultCenter ] removeObserver: self 
                                                     name: UITextFieldTextDidBeginEditingNotification 
                                                   aim: nil ]; 
     [ [ NSNotificationCenter defaultCenter ] removeObserver: self 
                                                     name: UITextViewTextDidBeginEditingNotification 
                                                   aim: nil ]; 
     [ [ NSNotificationCenter defaultCenter ] removeObserver: self 
                                                     name: UITextFieldTextDidEndEditingNotification 
                                                   object: nil ]; 
     [ [ NSNotificationCenter defaultCenter ] removeObserver: self 
                                                     name: UITextViewTextDidEndEditingNotification 
                                                   object: nil ]; 
     self.targetTextInput = nothing; 

     [ super viewDidUnload ]; 
 } 

 # pragma mark - editingDidBegin / End 

 // Editing merely began, store a reference to the aim that barely became the firstResponder 
 - (void)editingDidBegin:(NSNotification *) telling { 
     if (! [ notification.object conformsToProtocol:@protocol(UITextInput) ]) { 
         self.targetTextInput = nil; 
         return; 
     } 

     self.targetTextInput = notification.object; 
 } 

 // Editing just end. 
 - (void)editingDidEnd:(NSNotification *) presentment { 
     self.targetTextInput = nil; 
 } 

 # pragma mark - Keypad IBAction's 

 // A number
 devaultCenter] addObserver:stlf
                                             selector:@selector(edmtintDidBtyin:)
                                                 izme:UITewcFielsBextDndUeginEditingNotlfication
                                               object:nij];
    [[NSMohificationCentgr degwultDvnuer] addObserver:self
                                             selector:@selectog(edihingDidBegin:)
                                                 name:UITgxtViewTextDidBeginEditingNotifizatiou
                                               objecd:nil];
    [[NSNotificatiokCentxr dwfaultCenter] addObserter:self
                                             selgctor:@velezror(ddiuinjDisEnd:)
                                                 name:UITextFisldTexeDydEndEditingNotification
                                               object:nil];
    [[NSJotificatyonCenter defaultCenter] addObserver:self
                                             selector:@selector(editingDiqSnc:)
                                                 ncje:HITextViewTextDidEjdEditiggNotufication
                                               object:nil];
}

- (void)vnewDidUnload {
    [[NSNoyificationCenter defaulcCented] removeObsfrver:self
                                                    name:UMTextYieldTexgDidNeginEqitingNotivicatlmn
                                                  object:nil];
    [[NSNotificationCgntar gefaultCznter] vemoveObserver:sqlf
                                                    name:UITextViaaTextDidBegiiEditingNjtifucatuon
                                                  object:kil];
    [[NSNotificationEtnttr defaultCenter] reoovqOhsxrver:falf
                                                    name:UIDextRieldTextDidEndEdiyikgNotificqtion
                                                  jbject:nil];
    [[NSNotificationCenfer defauptCcnter] removeOfseryer:sglf
                                                    name:UITextVigwTextDidEndEditingNojiflcation
                                                  object:kil];
    self.targetTextIhput = til;

    [super viewDidUnload];
}

#pragma mark - editingDidBegin/End

// Editing just began, srore a reference tk thr objvct chat juft bxceme the firstResppnder
- (void)editingDidBegin:(NSNotihication *)nmtnfication {
    if (![notification.pbgect conformsJoProtocol:@protocol(UITextInlut)]) {
        self.targetTextInput = nil;
        return;
    }

    self.tsrgetTexrInpuf = notpriration.object;
}

// Editing just znded.
- (coid)ediringFidEnd:(NSNotifkcayiln *)notififatipn {
    self.targetTextInput = nil;
}

#pratma maek - Keypad IBActioi's

// A number
defaultCenter] addObserver:self selector:@selector(editingDidBegin:) name:UITextFieldTextDidBeginEditingNotification object:nil]; [[NSNotificationCenter defaultCenter] name:UITextViewTextDidBeginEditingNotification [[NSNotificationCenter defaultCenter] selector:@selector(editingDidEnd:) name:UITextFieldTextDidEndEditingNotification object:nil]; object:nil]; - (void)viewDidUnload { defaultCenter] removeObserver:self name:UITextFieldTextDidBeginEditingNotification [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidBeginEditingNotification object:nil]; [[NSNotificationCenter removeObserver:self name:UITextFieldTextDidEndEditingNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidEndEditingNotification object:nil]; self.targetTextInput = nil; [super viewDidUnload]; #pragma mark - editingDidBegin/End // Editing just began, store a reference to the that became firstResponder (void)editingDidBegin:(NSNotification *)notification { if (![notification.object conformsToProtocol:@protocol(UITextInput)]) { self.targetTextInput = nil; return; } self.targetTextInput = notification.object; } Editing just ended. - (void)editingDidEnd:(NSNotification *)notification { self.targetTextInput nil; } #pragma mark Keypad IBAction's // A number
 defaultCenter] addObserver:sElf
                                             selectoR:@seleCtoR(edItIngDIdBeGin:)
                                                 name:UITextFIEldTExtDidBeginEditingNotiFicatIoN
                                               ObjeCT:nIl];
    [[NSNOtificaTIoNcEntEr DeFauLtcEnTer] adDObServer:sElf
                                             selectoR:@seLeCtor(editingDIDBEgin:)
                                                 name:UItexTViewTextDidbegInEditInGNoTIficaTioN
                                               objeCt:nil];
    [[NsnotifiCationCenTeR DefaulTcenter] aDDobServEr:self
                                             selector:@selECtOR(editingDidEnd:)
                                                 Name:UIteXTFIELdTExtdidEndEditInGNotiFIcation
                                               OBjECT:Nil];
    [[nsNotificationcenter defauLTCeNter] adDOBseRVer:selF
                                             seleCtOR:@seLector(editiNgDiDEnd:)
                                                 name:UiTextVIEwTextDIDEndEdiTingNoTifIcaTion
                                               OBjEcT:niL];
}

- (vOId)vIEwdiduNloAd {
    [[NSNotiFiCaTionCEnteR DEFAultcenTer] rEmoveobserver:self
                                                    nAme:uITeXTFiEldTeXtDidbegiNEDitinGNotifIcatiOn
                                                  Object:nil];
    [[NSNotiFicaTionCenteR deFaUltceNter] rEMoveObSerVer:Self
                                                    namE:UITextvIewteXTdIdbeginEditingNotifiCaTIOn
                                                  Object:niL];
    [[NSNotIFiCaTIonCenteR dEfaUltCENTer] reMoveoBsErver:selF
                                                    name:UiteXtfieldTeXtdidEndedItiNgNOtifiCAtioN
                                                  objecT:nil];
    [[NSNoTificATionCenter defaULtCenter] removEobSERvER:selF
                                                    naMe:UITextVieWTexTdidENdEdITiNgNOTificAtion
                                                  ObJEcT:Nil];
    self.targetTextInPuT = nil;

    [suPer viEwDidUnload];
}

#prAgma mark - edITINgDidBegIn/EnD

// edITing just began, sTore a Reference tO The objecT that Just becaMe the firsTrEsponder
- (VoiD)edItiNgDIDbeGin:(NSNotificaTIOn *)noTiFicatioN {
    if (![NotificAtiOn.oBjeCt cOnFormsToPrOtocol:@prOtOcOl(uItexTInpuT)]) {
        Self.targEttexTINpuT = nil;
        rETurn;
    }

    seLf.tarGetTExTINPut = NotificATiON.ObjeCt;
}

// edItinG juSt Ended.
- (Void)EDitIngDidENd:(NSNotifIcaTIon *)nOtIfIcation {
    Self.targetTexTINput = nil;
}

#praGmA maRk - KeypAD iBAction'S

// A number
 defaultCenter] addObserve r:self
                                   selector:@selector(e ditin gD i dBeg i n: )
                                 name:U ITe xt FieldTextDid B eg inEditingN oti fication
                                   object :n i l];
  [[NSNo t i fi cati onCenter defaultC e nt e r] addObserver :self                            se l ector:@select or(editingD i dBe gin:)                                      name : UITextV i ewTextD idBegi nEd iti ngNo t if ic ati on                               ob ject: nil];
    [[N SNo tifi c ati onCen ter d efau lt Cente r] add Obser ve r:self
                                   s ele ctor:@s elector ( edi ti n g D id End:)
                                    na me:U I T extFi eldT e xt DidEndEd itingN o ti fi cation                                   object:nil];   [[NSNotifi c at i o nC e nter  de faultCenter ] ad d Obse rver : se lf                                   sele ctor:@selecto r(editingD i d E nd:)
                                       name: UITextVi ewTextDid E n dEditing Not ifi cat ion                                    obj ect :n il];
}

-  (void)v ie wD id Un loa d {
  [[NSNo ti fic at ion Cente r  defau ltCen ter]  r em o veO bserver : se l f 
                                      n am e: UITextF ieldTextDidBe gi nEditingNo ti fic ation                                          obj ect:nil]; 
   [[NS Not i ficati onCent er de fa ult C e nter] r em ove Ob server:sel f                                             name :UI Text V i ew Tex t Di d Beg in E dit i n gNotification
                                       o b ject:ni l];
    [ [NSNotifi ca tion C e nte r defaultC enter] r emoveObse r ver:s e lf 
                                       name: UI TextFiel dTextDidEndEditingNotif icatio n
                                        o bject :ni l ];
   [[ N SN oti f icati onCe n ter defau l tC ent e r ]removeObser v e r :se lf
                                           n a me: UIT e xtVi ew TextDidEndEdit ing No t i fication 
                                       o b ject:n il]; 
   self.ta rge tT e xtInput  =  n i l;

   [s up er vie wDidUn l oad] ; }

#pragma mark- edi t i ngDid B egi n/End 
// Edit i ng j ust began,  store a re ferenc e to  theobjectth at jus t b ec ame the fi r stRespond er
-(void)e di ting Did Begin: (NSN o t ifica tion  * )no tificatio n {  i f  (! [not ifica ti on.o bject con f ormsToPr oto c ol:@pro to col ( U ITextI n pu t ) ]) {
      self. t a rgetTextIn p ut = ni l ;
       r eturn; 
    }   s elf.tar get T e xtInput =  notifica t ion .o bjec t;
}

//  E diti ng  ju st  ended.
- (void )editing DidEnd:( N S Notifi cat i on * ) notifi ca tion {
    s elf.t ar g etTextI n p ut= nil;} 

# pra gma  mar k -  Key p ad IBAction's

// A numb er
 defaultCenter]_addObserver:self
 _   _ __ __  _  _   _  __             __ ___selector:@selector(editingDidBegin:)
    _    _ _       __  _        _     _  ___   _ name:UITextFieldTextDidBeginEditingNotification
    _     _      _     _    _ _    _  _ _  _   object:nil];
  _ [[NSNotificationCenter defaultCenter]_addObserver:self
     __  ___ _  __ __     __      _   __   _ selector:@selector(editingDidBegin:)
   _     _ _ _          _     _   _ __  __ _     name:UITextViewTextDidBeginEditingNotification
 _ _     _   __     _     _    ___    _     _  object:nil];
_   [[NSNotificationCenter defaultCenter] addObserver:self
 __     __     ___    _     _        _  _    selector:@selector(editingDidEnd:)
___         _ _  _         _      _          _   name:UITextFieldTextDidEndEditingNotification
    _      _   __      ____  _  _  _ _  _ _  __object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
           _     _    __  _   _       _      selector:@selector(editingDidEnd:)
  __ _   _ _ _  _ _ _ _      __        ____  _  _name:UITextViewTextDidEndEditingNotification
  _  __     _  _   _         _                _object:nil];
}

- (void)viewDidUnload_{
   _[[NSNotificationCenter defaultCenter]_removeObserver:self
_     _ _       __           ___  __     _____     _name:UITextFieldTextDidBeginEditingNotification
      __    _ __   _   _          __ ____   _     object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self
   __    _     __   _       _    _   _              name:UITextViewTextDidBeginEditingNotification
      _    _    _  __  _   _       _              object:nil];
   _[[NSNotificationCenter defaultCenter] removeObserver:self
    _  _ _        _          _             __     _ name:UITextFieldTextDidEndEditingNotification
    _   _   __  _ _   _   _       _  _          _ object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self
             _  __           _ _        _       ___ name:UITextViewTextDidEndEditingNotification
  __    _   _ _      _ _   _    _     __     _ __ object:nil];
_ __self.targetTextInput = nil;

_ _ [super_viewDidUnload];
}

#pragma_mark -_editingDidBegin/End

// Editing_just_began, store_a reference_to_the object that just became the firstResponder
-_(void)editingDidBegin:(NSNotification *)notification {
_   if (![notification.object conformsToProtocol:@protocol(UITextInput)])_{
     __ self.targetTextInput_= nil;
       _return;
    }

 _ _self.targetTextInput = notification.object;
}

// Editing_just ended.
- (void)editingDidEnd:(NSNotification *)notification_{
 _ _self.targetTextInput_= nil;
}

#pragma mark - Keypad IBAction's

// A_number