this keeps giving me:
Yes was initialized as
in .h
Using ARC is that why??
Not Working. code:
*** OK Found it. Working code here but .. seems like a lot of trouble to replace a few strings. Can someone explain why, I needed to do all this??
or is there an easier/better solution??
This feels messy/ugly.
Code:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to mutate immutable object with replaceCharactersInRange:withString:'
*** First throw call stack:
Code:
"NSMutableString *repImage;"
Using ARC is that why??
Not Working. code:
Code:
if ([self.repImage rangeOfString:@"T"].location != NSNotFound) {
NSRange foundT = [ self.repImage rangeOfString:@"T"];
[self.repImage replaceCharactersInRange:foundT withString:@"10"];
// NSLog(@"replacing T replacing with 10");
}
*** OK Found it. Working code here but .. seems like a lot of trouble to replace a few strings. Can someone explain why, I needed to do all this??
or is there an easier/better solution??
This feels messy/ugly.
Code:
NSMutableString *relpacerImage = [[NSMutableString alloc]init];
relpacerImage = [NSMutableString stringWithFormat:@"%@",self.repImage];
if ([relpacerImage rangeOfString:@"T"].location != NSNotFound) {
NSRange foundT = [relpacerImage rangeOfString:@"T"];
[relpacerImage replaceCharactersInRange:foundT withString:@"10"];
self.repImage= [NSMutableString stringWithFormat:@"%@",relpacerImage];
NSLog(@"save X replacing with Y");
}
Last edited: