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

Ruske Frost

macrumors newbie
Original poster
Jul 1, 2011
4
0
Hey all, I just started learning Objective C 2.0 via Stephen Kochan's book (literally just about a half hour ago) and I'm wondering if i can remove the date stamp produced in every line of my target output after an NSLog entry?

I'm trying to remove some of the bulk mixed in with what actually took place. Makes it feel a little more clean and easier to understand for someone such as myself :)

Thanks.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,740
8,416
A sea of green
Hey all, I just started learning Objective C 2.0 via Stephen Kochan's book (literally just about a half hour ago) and I'm wondering if i can remove the date stamp produced in every line of my target output after an NSLog entry.

Short answer: No.

Long answer: Not that I'm aware of, although you could probably write your own replacement, once you know more, or copy someone else's:
http://stackoverflow.com/questions/1705318/nslog-suppress-date

This also has some useful tips:
http://stackoverflow.com/questions/969130/nslog-tips-and-tricks
 

wlh99

macrumors 6502
Feb 7, 2008
272
0
In the long run, it probably won't matter.

NSLog is meant to log information to the console, not for general I/O. Logs generally include a timestamp.

Later in your learning you will use other methods for I/O, but for now NSLog doens't require much of an education.

You could read up on printf, and for some uses you could use it in place of NSLog. However, you can't (directly) print an NSString with printf. For the fraction examples it might work fine.
 

Ruske Frost

macrumors newbie
Original poster
Jul 1, 2011
4
0
Alright, well, if there's nothing that can be done it's alright. I just wanted to see if there was a more "clean" way to see what my literal output would look like (without anything extra) - and by the way, is there a way to have an additional window or something like that to preview what the output or product of what is written will be?

I assume no, since the answer to my first question was no (and this question was nearly the same...). But I figured I'd just give it a shot.

If not I'll just get used to it like everyone else does :)

Thank you for your quick replies, by the way.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.