Hi i am having a UILABEL and UITEXTFIELD in a customtableviewcell.I need to update the UILABEL upon each character change.As i update the each character in the textfield keyboard is dismissing ..I even tried using Notification centre. Any quick help would be thankful
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
NSString *rateValue=[textField.text stringByReplacingCharactersInRange:range withString:string];
NSCharacterSet *notAllowedChars = [[NSCharacterSet characterSetWithCharactersInString:@"1234567890"] invertedSet];
NSString *resultString = [[rateValue componentsSeparatedByCharactersInSet:notAllowedChars] componentsJoinedByString:@""];
[arrayRates replaceObjectAtIndex:textField.tag withObject:resultString];
selectedTextField=textField;
selectedTxtFieldPath = [NSIndexPath indexPathForRow:textField.tag inSection:0];
[self.tableViewSkuVoids beginUpdates];
[self.tableViewSkuVoids reloadRowsAtIndexPaths:@[selectedTxtFieldPath] withRowAnimation:UITableViewRowAnimationFade];
[self.tableViewSkuVoids endUpdates];
[[self.tableViewSkuVoids superview] endEditing:NO];
[[NSNotificationCenter defaultCenter] postNotificationName:@"keyboardWillShow" object:nil userInfo:nil];
[selectedTextField becomeFirstResponder];
return YES;
}