'Currency Mask infinite loop
I need to create a currency mask. I did lines of command and it's works fine, but when I set the value in textfield, an infinite loop occurred. I monitoring the textfield with Editing Changed behavior, to catch each caracter that the user set, but when I try to change the text value, the infinity loop happens.
Solution 1:[1]
Are you setting the text in the textFieldDidChange? Because if you do, the textFieldDidChange notification is going to fire again and the text is set again and the notification will fire again and so on...
I tried doing this as well. The only solution I could come up with is formatting your text when the user leaves the textField. I did not find a way to reliable format the contents of the textField while the user was editing it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | vinzee |
