I am a java programer, I found that the Java is very gd at doing string. If I want to do this objective c, how can I do in objective c:
System.out.println("This is a "+123+" test");
I am a java programer, I found that the Java is very gd at doing string. If I want to do this objective c, how can I do in objective c:
System.out.println("This is a "+123+" test");
To place an integer into a string, you can do this:
int n = 123;
NSString *s = [NSString stringWithFormat:@"This is a %d test", n];
There are numerous other ways. But concatenating strings with integers by + operator is not one of them. :)
To simply print to the console you could try:
int num = 123;
printf("This is a %i test", num);