How to check the character is backspace (delete)


- (BOOL) textField:(UITextField *) textField
shouldChangeCharactersInRange:(NSRange) range
            replacementString:(NSString *) string
{
     if ([string length])
     {
          if ([string characterAtIndex:0] == 10)
          {
               NSLog(@"keyboard backspace pressed");
          }
      }
      return YES;
}

Blogged with the Flock Browser
Advertisements

How to get device orientation on iOS Simulator 4.2

[[UIDevice currentDevice] orientation] won’t work on simulator,

instead use

[UIApplication sharedApplication] statusBarOrientation];

Blogged with the Flock Browser