Messages to Nowhere
January 3, 2008This article has been updated, and moved here
This article has been updated, and moved here
This article has been updated moved to a new location.
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 [...]
This is a bit of the design process behind one line of one settings panel inside IMLocation.
The “Locations” panel controls everything having to do with to locations. The pane’s “headline”, outlined in red, shows what is assumed to be the current location.
It reads like “Your current location is home”. It does not say [...]
Before you consider using any of the unsupported hacks I’m about to discuss, check to see if existing frameworks , or iChat’s AppleScript interface, will do what you need. Any software update can break unsupported code in unpredictable ways at any time. When Leopard came out, all the hacks I had been using [...]
This article has been updated, and republished here.
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 [...]
When writing a short AppleScript to complete a specific task, do not write a procedure that checks if A exists, then operates on it if it does. Instead, write an expression that operates on A, and ignore any exceptions caused by A not existing. Surrounding the statement in a try-block will ignore any [...]
This article has been updated, and moved here.
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 [...]