Programming Reference/Librarys
Question & Answer
Q&A is closed
-(NSString *)stringByAppendingString:(NSString *)aString;
Returns a new string made by appending a given string to the receiver.
NSString *cycle=@"Pass"; for(int a=0; a<5; a++) { NSString *intValue=[NSString stringWithFormat:@"%i", a]; cycle=[cycle stringByAppendingString:intValue]; NSLog(@"%@", cycle); }
output:
2012-04-15 12:08:02.994 FoundationNSString[633:403] Pass0 2012-04-15 12:08:02.998 FoundationNSString[633:403] Pass01 2012-04-15 12:08:02.998 FoundationNSString[633:403] Pass012 2012-04-15 12:08:03.000 FoundationNSString[633:403] Pass0123 2012-04-15 12:08:03.001 FoundationNSString[633:403] Pass01234