perhaps bestalignmentfortext  returns garbage when self is not first responder  if your method returns correct values when  self firstresponder  and you do not have any particular reason to have this  pls remove it  