Hi,
I'm sure it's something really simple but the following code in my project:
NSMutableString *temp = [[NSMutableString alloc] initWithString:[firstNumber stringValue]];
NSArray *splitInput = [[NSArray alloc]initWithArray:[temp componentsSeparatedByString
"x"]];
NSMutableString *f = ( NSMutableString * )[splitInput objectAtIndex:1];
[f insertString: ( NSMutableString * ) @"00000000" atIndex:0];
Where 'firstNumber' is the outlet from a standard text field in the main window.
It produces the error:
Attempt to mutate immutable object with insertString:atIndex:
My code's a very early stage timecode calculator, so the user can enter '4x23' and the '23' needs to ultimately be padded with zeroes. I realise there's probably a better way by using 'NSNumberFormatter', but now I've a flea in my ear and I'd just like to know what I've done wrong.
Many thanks!
Todd.
I'm sure it's something really simple but the following code in my project:
NSMutableString *temp = [[NSMutableString alloc] initWithString:[firstNumber stringValue]];
NSArray *splitInput = [[NSArray alloc]initWithArray:[temp componentsSeparatedByString
NSMutableString *f = ( NSMutableString * )[splitInput objectAtIndex:1];
[f insertString: ( NSMutableString * ) @"00000000" atIndex:0];
Where 'firstNumber' is the outlet from a standard text field in the main window.
It produces the error:
Attempt to mutate immutable object with insertString:atIndex:
My code's a very early stage timecode calculator, so the user can enter '4x23' and the '23' needs to ultimately be padded with zeroes. I realise there's probably a better way by using 'NSNumberFormatter', but now I've a flea in my ear and I'd just like to know what I've done wrong.
Many thanks!
Todd.