You need to convert curentVal back to an object, in this case a NSString.
There is also a typeo in the for statement.
NSMutableArray* marray = [[NSMutableArray alloc] initWithObjects:@"1", @"2", @"3", nil];
NSLog(@"marray: %@", marray);
for (NSInteger i = 0; i<[marray count]; i++) {
NSInteger curentVal = [[marray objectAtIndex:i] intValue];
curentVal += 5;
NSString *curentValString = [NSString stringWithFormat:@"%ld", (long)curentVal];
[marray replaceObjectAtIndex:i withObject: curentValString];
}
NSLog(@"marray: %@", marray);
Output:
marray: (
1,
2,
3
)
marray: (
6,
7,
8
)
Here is the same approach with NSNumbers:
NSMutableArray* marray = [[NSMutableArray alloc] initWithObjects:@1, @2, @3, nil];
for (NSInteger i = 0; i<[marray count]; i++) {
NSInteger curentVal = [[marray objectAtIndex:i] intValue];
curentVal += 5;
[marray replaceObjectAtIndex:i withObject:@(curentVal)];
}