Something that comes up regularly in iPhone development is the need to convert NSNumber objects to NSString objects and vice versa. For converting an NSNumber to an NSString, there is the -stringValue method, which is useful if you want just the plain number without any extra formatting. This isn’t particularly useful for presenting numbers in a user interface however, since -stringValue doesn’t give you any control over how the number is formatted.
If you use Shaun Inman’s Mint stat tracking software on a WordPress based site, as I do on Forge Code, you probably use the Bird Feeder Pepper. This ‘Pepper’ – the name given to Mint plugins/widgets – tracks the number of hits on your RSS feeds. The normal way to get Bird Feeder to collect this data is to manually modify the content of the PHP template file(s) in WordPress that are used to generate the content of your RSS feeds.
The first few times I tried developing a Preference Pane in OS X, I had more than a few head-scratching, “what the heck do I do now?” kind of moments. Unlike a typical Mac OS X or iPhone project in Xcode, when you create a Preference Pane project from the built-in Xcode template, doing a ‘Build and Run’ doesn’t result in your project being run. In fact, as of Xcode 3.2.1 the ‘Build and Run’ item in the ‘Build’ menu is disabled ‘out of the box’. This is due to the fact that your project isn’t building an executable program, it’s building a .prefPane bundle/plug-in.
Getting ‘Build and Run’ (⌘+R) to work as you might expect for a PrefPane project (by building your .prefPane, then installing it in System Preferences.app and loading it) isn’t hard, but it’s not at all well documented.
About 2 weeks ago, I made a post to the rb-appscript-discuss mailing list about an error I was receiving while working with rb-appscript. rb-appscript is an event bridge that allows you to use Ruby instead of AppleScript to communicate with scriptable applications on Mac OS X.
As a programmer, I find AppleScript tedious at best. For better or worse, my brain has adapted to understanding programming languages that have non-ambiguous, concise grammars. I find it a lot easier to use a “real” programming language, and luckily enough, in 2009, we can use a number of languages as an AppleScript substitute, including Ruby.
Older posts can be found in the archive.