The purpose of the code shown below is to take a string from a textfield and remove commas and left parentheses, to prepare the contents for conversion to a float. For example, it takes the number 1,234,567 and changes it to 1234567.
The code snippet works, but returns an informational error "Incompatible pointer types assigning to NSMutableString * from String *"
When I use NSString instead of NSMutableString, I get no errors, but the returned value is an empty string.
Using the NSMutableString methodology, what is the problem and how can I change this to eliminate the 'Incompatible pointer type" error.
NSMutableString *cleanedDataCellTest = [[NSMutableString alloc] initWithString:datacellR2C2.text];
cleanedDataCellTest = [cleanedDataCellTest stringByReplacingOccurrencesOfString:@"," withString:@""];
cleanedDataCellTest = [cleanedDataCellTest stringByReplacingOccurrencesOfString:@")" withString:@""];
cleanedDataCellTest = [cleanedDataCellTest stringByReplacingOccurrencesOfString:@"(" withString:@"-"];
cleanedDataCellTest = [cleanedDataCellTest stringByReplacingOccurrencesOfString:@" " withString:@""];