Author Archives: Jens Ayton

Almost elegant cave man debugging

Recently, the Twitternets pointed me at Vincent Gable’s blog post, The Most Useful Objective-C Code I’ve Ever Written. It is indeed quite useful; given a semi-arbitrary expression, it prints out the value, using @encode() and macros to minimize drudgery.

Posted in Cocoa, Code | Tagged , | 6 Comments

Black Tuesday

█████ ███ ██████ ███ FRA ████ ███████ ██████. Continue reading

Posted in Politics | Tagged | Leave a comment

Proposal: generics (and some other stuff) for Objective-C

Some time ago, Greg Parker asked the Twitternets what we’d like to see in a purely hypothetical Objective-C-without-the-C language. Someone — I believe it was Landon Fuller — pointed at an article about the Strongtalk type system for Smalltalk. I … Continue reading

Posted in Cocoa, Code | Tagged , , , , , | 9 Comments

Multi-type Save Panel Controller

As a change of pace, I thought I’d post some code that doesn’t go out of its way to be bad. JAMultiTypeSavePanelController is a class (abstracted from ImageIO Export for Acorn) to handle the case where you want to offer … Continue reading

Posted in Cocoa, Code | Leave a comment

Wanted: a Right-Handed Keyboard

My current keyboard looks like this: (Well, roughly. It actually looks like this, but I couldn’t find a decent-resolution Swedish one.) This was a sensible design for the right-handed majority when it was introduced, some time in the stone age. … Continue reading

Posted in Hardware | 4 Comments

Net Neutrality (EU edition)

Network neutrality in Europe is under threat. Not in some vague possible future; right now. In one week, on Tuesday the fifth of May, the European Parliament will vote on the second reading of the Telecoms Package and amendments. I … Continue reading

Posted in Politics | Tagged | Leave a comment

Constant objects for fun and non-profit

The @"foo" operator for constant NSString objects in Objective-C is extremely convenient. Indeed, if it wasn’t there, programming with Cocoa would be a royal pain. Many of us have at various points wished there was equivalent syntax for NSNumbers, and … Continue reading

Posted in Cocoa, Code | Tagged | 3 Comments

Fun with the Objective-C Runtime

Ever since Leopard came out, I’ve wanted to do something useful with resolveInstanceMethod:. The opportunity has yet to present itself. However, I have done a couple of really silly things with it, which have until now languished in obscurity in … Continue reading

Posted in Cocoa, Code | 4 Comments

Migratory Code

Of the two people I know of who have tried to get at some of my code releases in the past year, a full 50 % have given up and written a new implementation from scratch because downloading and opening a … Continue reading

Posted in Code | Tagged , , | Leave a comment

Key to QWERTY

Recently on the Twitterwebs, Peter Hosey asked for a library that takes a character and returns the corresponding virtual key code (implicitly, in the U.S. keyboard layout). The intention was to use it to specify default key bindings when binding … Continue reading

Posted in Code | Leave a comment