Remove date stamp?

Discussion in 'Mac Programming' started by Ruske Frost, Jul 22, 2011.

  1. Ruske Frost macrumors newbie

    Joined:
    Jul 1, 2011
    #1
    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.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    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
     
  3. wlh99 macrumors 6502

    Joined:
    Feb 7, 2008
    #3
    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.
     
  4. Ruske Frost thread starter macrumors newbie

    Joined:
    Jul 1, 2011
    #4
    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.
     

Share This Page