Monday, January 28, 2008

Debugging Dashboard Widgets

The best source for debugging information comes by Apple itself! Apple released a technical note full of Widget debugging information and techniques. It is Technical Note TN2139. You can find it here.


The best technique for debugging Widgets is to use the alert() function. alert() statements are written to the Console. Please remember to remove your alert() function calls when you finish debugging or otherwise your Console logs may become too crowded. The TN2139 Technical Note explains in more detail the printing of the debug information in both the Dashboard environment and Safari.

One last advice when your newly developed Widget is not working properly: check that you have all the compulsory files included in the Widget bundle. I found that this is the most usual case when I was having difficulties with my Widgets. . . The next more frequent reason was misspelled filenames.

Did you find the above information helpful? You will find a lot more information in my eBook "Programming Dashboard Widgets". The eBook describes how you can create Apple Dashboard Widgets using many programming languages including JavaScript, Perl, Objective-C, and PHP. You can buy it here.

No comments: