Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

blue-lion

macrumors member
Original poster
Jan 26, 2010
50
0
Hello, i believe the NSLog statement starts a new line each time it is used(like \n) . is there a way to prevent this? i.e. so multiple print statements appear back to back?

p.s. i don't just mean comma delimited either.
 
I'm pretty sure there's no way to do that.

You can use printf() or the related functions for this.

Also, you can build up a single string with all the text that you want and then print it in a single call to NSLog.
 
NSLog

Yes, i was thinking of combining strings using append....
Basically , i would like to neatly print playing card descriptions across the screen in columns of threes and left justified

Ace of clubs 4 of diamonds 6 of hearts
5 of diamonds

and so on...

i have tried using something like
NSLog(@"%-15s",[[tempCard CardDesc ] UTF8String]);

but i would like to link these together in threes, plus i don't really understand the syntax of these special strings???
 
Last edited:
By screen I guess you mean the debugger console.

I use printf quite a bit for this kind of logging because it doesn't end up the system console, unlike NSLog. I really don't need this kind of debugging info filling up my system console.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.