I need to output one line with two calls to NSLog. I thought the code was:

int i = 0; NSLog(@"Number "); ... NSLog(@"%d", i); 

Will show:

Number 0

But he prints:

 Number 0 

NSLog inserts a new line automatically. How do I add the first call to NSLog?

    3 answers 3

    This is not correct, use either a buffer or a printf- like function.

    • The question requires 2 NSLog calls, not one. - BiMaWa

    Maybe so, or I did not understand the question.

     int i = 0; NSLog(@"Number %d", i); 
       int i = 0; printf("Number "); printf("%d", i);