 <p>If you still need to write code under <code>-(void)methodA</code> do</p> <pre><code>-(void)methodA { if(!isKeyBoarHidden){ [textField resignFirstResponder]; } else{ //code here } } - (void)keyboardHidden:(NSNotification *)notification { isKeyBoarHidden = YES; [self methodA]; } </code></pre> <p>sometime it may be helpful if we have some local variables inside <code>methodA</code> and we dont need to make variables global.</p>