I have a textfield that accepts numbers and I am trying to replace the 8th character in the string with a "."
if(self.txtQty.text.length >= 8){
NSRange range = NSMakeRange(8,1);
self.txtQty.text = [self.txtQty.text stringByReplacingCharactersInRange:range withString:@"."];
}
-Example-
1234567.90
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds' *** First throw call stack:
I keep receiving this error.