Re: General Question: Debugging these "NS" Objects: Answered
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.