I have written some code that will parse a text field and replace it with only the numeric values that were typed in. For example if the user types in: 200,000 I will parse it and set the value in the field to 200000. The code works perfectly in the simulator, but on the device it fails. When I debug on the device I can see that the if statement in the code never gets triggered. This is very strange because it will get triggered on the simulator. I have supplied the code below in case it helps. Please let me know if you have any recommendations.
Yep, you really need to read the Objective-C docs. Besides all the memory leaks talked about in your other thread there are many other things wrong with this code, or at least things that can be done better.
The biggest thing that is causing your problem is the string comparisons. You can't compare two strings for equality by using the '==' operator. In all the C derived languages, among many others, the '==' operator compares if two objects are the same object, not the same value. The NSString class has the method 'isEqualToString:'. So change:
one_char == testp
to:
[one_char isEqualToString:testp]
And to create a string you are doing it in a very inefficient way. For example, instead of: