Concatenating Strings in Obj C
- by eco_bach
Hi
It seems that Objective C jumps thru hoops to make seemingly simple tasks extremely difficult.
I simply need to create a sequence of strings, image1.jpg, image2.jpg, etc etc
ie in a loop
var imgString:String='image'+i+'.jpg;
I assume a best practice is to use a NSMutableString with appendString method?
What am I doing wrong??
NSMutableString *imgString;
for(int i=1;i<=NUMIMAGES;i++){
imgString.appendString(@"image"+i+@".jpg");
}
I get the following error
error: request for member 'appendString' in something not a structure or union