• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: General Question: Debugging these "NS" Objects: Answered
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: General Question: Debugging these "NS" Objects: Answered


  • Subject: Re: General Question: Debugging these "NS" Objects: Answered
  • From: "b.bum" <email@hidden>
  • Date: Sun, 15 Feb 2004 22:15:18 -0800

On Feb 15, 2004, at 9:55 PM, Jerry Krinock wrote:
In the old days, I was under the impression that debugging with

std::cout << myVariable << endl ;

was the mark of an amateur, and that _real_ programmers used the debugger.

However, the concensus of the replies I've received is that, since
Objective-C objects are so opaque, even the _real_ programmers are doing
stuff like:

NSLog([gConjunctions description]) ;

So I shall join you all in using this method and not be ashamed of it.
Thanks for all your replies.

heh.

The question is: what are you trying to debug?

If it is the individual lines of code you are trying to debug -- how a method is changing state of an object, etc -- then the debugger is totally the right tool to use.

The problem is that we are all often trying to debug the overall object graph within an app. I.e. as events, etc, are processed, how does the state of the object graph change over the lifetime of the app. To these ends, constantly stopping in the debugger to check something then hit continue is really inefficient.

End result; NSLog() statement sprinkled throughout the code so you can easily see the code paths the app is following, etc...

Now that Panther has shipped, logging based debugging to explore object graph state is now not what *real* programmers are doing. *Real* Cocoa developers toss a table view into their UI and use Cocoa Bindings to bind it to some random array attribute in the app to explore app state.... Then you can easily use an NSTextView or another NSTableView to explore the object graph further. ;-)

b.bum
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: General Question: Debugging these "NS" Objects: Answered
      • From: Jerry Krinock <email@hidden>
References: 
 >Re: General Question: Debugging these "NS" Objects: Answered (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: General Question: Debugging these "NS" Objects: Answered
  • Next by Date: Re: How do I soft-wrap text at a specific line length?
  • Previous by thread: Re: General Question: Debugging these "NS" Objects: Answered
  • Next by thread: Re: General Question: Debugging these "NS" Objects: Answered
  • Index(es):
    • Date
    • Thread