Archive for the 'Debugging' Category

Messages to Nowhere

January 3, 2008

This article has been updated, and moved here

What Quality Means

December 18, 2007

I was blown away when I read the first part of this talk given by Joel Spolsky at Yale, because it so totally nails problems I’ve seen at Microsoft and problems at my alma mater.
I was also reminded of Will Shipley’s excellent article on the limitations of unit-testing.

NSWorkspace Bug in - openFile: ?

December 7, 2007

EDITED TO ADD: I could reproduce this bug in a large project, but not isolate it in a smaller one. It is much likely for my code to have a bug then NSWorkspace. I’m still not 100% certain that this issue wasn’t my fault in some way I don’t understand. But no [...]

Crash Logs

December 7, 2007

Daniel Jalkut on how to get the most out of crash logs. It’s good advice.
Actually I do have one big issue with the article:
If there’s one behavior of your application that you should focus on eliminating, it’s the behavior of crashing. Above all other “nuisances,” this is the one that is absolutely unacceptable.
But preserving someone’s [...]

Assert Outlet Connections

October 16, 2007

This simple NSCAssert has saved me a lot of bother. In any class that has an IBOutlet connected to something, Put
NSCAssert(outlet1 && outlet2 && … && outletn, @”An outlet got disconnected!”);
in the awakeFromNib method. Then if you ever accidentally disconnect an outlet, you’ll find out about it quickly.
I think this is a worthwhile [...]

NSAlert Sheet Not Having Focus

October 11, 2007

EDITED TO ADD: Several months later, I ran into this same bug again!
I had an issue where if I used
beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:
to put up an NSAlert as a sheet inside a window, and I was not running on the main thread, the sheet would not have focus. I’m not sure exactly why, but this solution worked [...]

Objects that Won’t Hide

October 2, 2007

This article has been updated, and moved here.

Strange Objects (NSCFType, etc.) Indicate Memory Management Bugs.

September 13, 2007

Any errors involving NSCFType or some class you have never heard of (eg ” *** -[NSCFType count]: selector not recognized “) are indicators of a memory management bug. Most likely an object is getting released too soon. The freed memory is then re-allocated for a new object, say an NSCFType. The pointer [...]