Skip to content

{ Category Archives } Programming for Apples

Fake Telnet

Is some example code to demonstrate using NSStream. Download here. It uses a category to append to NSTextView, which is a force of habit thing. An efficient append method which scrolls to visible should exist, that handles NSString and NSAttributedString (and quite possibly NSData with an encoding). While writing this category (or rather, rewriting it […]


Something simple – like a socket set, maybe

Understand from the start that I have forgotten more about TCP port programming than many people ever get to know. I’m not joking, either; I don’t remember large APIs at all well, and have always relied on decent documentation to keep it all together. Liz and I sometimes remark that my modus operandi is that […]


Amazon lists

I have created two Amazon booklists, one for WebObjects, the other for Cocoa. They should show up if you do a search on Amazon (UK only, I think), for “Cocoa Programming”, or “WebObjects”. I don’t get any referral fees from these lists, so they are a labour of love, and I intend to keep them […]

Tagged , , ,

Cocoa Internet Version Checking – check for updates…

It seems that almost every new app you see out there has an on-line version checking system. I remember when the first ones started to appear in Cocoa land (probably from Omni), and I sort of coasted and ignored them. Anyway, this week I was running a Cocoa class, and the question arose. There’s an […]



I like Python. It’s a scripting language, in a similar vein to Perl. However, to steal an analogy from someone else, where Perl is executable line-noise, Python is executable pseudocode. It’s an easy language to get into. Its most immediately visible difference from, say, C or Java is that it doesn’t use semi-colons or {}. […]


Search and Replace

This is more complex than it needs to be, for unobvious reasons. The problem, succinctly stated, is implementing regular expressions with Java. For historical WebObjects reasons, I have not had easy access to a regexp library. Java people have used the open source JEdit libraries to implement regular expressions, but with WebObjects this was too […]

Tagged ,

Decision tables, when to use

This is genuine 1960s technology, but it moves forward into 1970s technology (OOP) very well. Here’s the situation: you have a combination of two variables that need checking; for an example, perhaps an object has a status flag with a few different states, like failed, on hold, incomplete and registered – and you need to […]

Tagged , ,

Java date arithmetic

I am used to using the old (deprecated) WebObjects NSTimestamp class to do basic arithmetic on dates; it was easy with one method call to add an arbitrary number of days/weeks and get the correct date, or even to calculate the difference between two dates. In the new (release 5.0, so not that new) world […]

Tagged ,

Better, Faster, Lighter Java

I saw this title in a press release from O’Reilly, and was intrigued by the description. For the last few years I have been letting myself concentrate almost entirely on WebObjects, and along the way I have acquired a few programming habits as I have matured as a programmer. This book seemed to embody them […]

Tagged ,

Looking Around

One problem with being a long term WebObjects developer is that I get extremely jaded when viewing other technologies. WebObjects isn’t perfect, there’s lots of room for improvement, but for a very early (’95/’96) web application server, it is remarkably mature. It has a persistence layer, application server and template engine, as well as a […]

Tagged ,