Coding on Apple is still a love/hate relationship

So, it’s been almost two years since I posted anything here, and it’s just over two years (almost to the day), since I last had a good whinge about XCode. It has only been laziness that has kept me from spewing much guts here about all kinds of annoyances.

So, I’ve been learning Swift for the past year, and whilst it was long overdue, it’s only the language part of the equation. The Cocoa API is still a nasty piece of work; give me the .NET Framework and C# ANY DAY (except if that means I have to use Windows at home; sorry, but I can use it at work writing web services and such like, but I’m not letting that operating system near my computer at home).

So, here’s what drove me mad about XCode/Swift/Cocoa today:

I used to have a drag/drop connection between a combobox and a class to handle the selection change event. That worked fine, however, when I modified it to also handle updating something as the user typed each letter in the combobox, the handling of selection changes failed. You can only handle one or the other when doing the drag/drop connection crap between the combobox and the IBAction.

So, I found a delegate method, which means that I modified the relevant view controller to implement the NSComboBoxDelegate protocol so that it suddenly receives all of the methods in that protocol, whether I implement them or not; the ones I care to implement actually do get called, and the others are ignored. This seems strange to a .NET programmer, and takes a bit of getting used to, but it can also be very powerful (and a time saver in some cases).

This delegate method is the comboBoxSelectionDidChange notification. Being a “did change” event you’d think that it would only call the method when I have actually finished selecting an item from the drop-down list portion of the combobox. You would be mistaken. Past tense apparently isn’t past tense in Cocoa.

Only one problem: if I use “combo.stringValue” inside that method it still returns the previous value in the text part of the combobox. If I want to get the text of the item that the user selected, I’ve got to do this:

dateCombo.itemObjectValueAtIndex(dateCombo.indexOfSelectedItem) as! String

I do not have the words to describe my disappointment.

Come on Apple, the Cocoa framework needs a decent upgrade.


Crappy Linux Twitter Clients

I’ve about had it with the range of Twitter clients on offer in Linux. Twitux seems capable of producing nothing but “Timeline Parse Error” messages these days, so I went looking for something else. Found two possibilities: gTwitter and Gwibber. Judging by the screenshots, Gwibber is a screen real-estate hog, so I don’t think I’ll bother with that. So that leaves gTwitter. More disappointment in store, it seems…

I install gTwitter and land at a preference window, which is fine. Entered what I thought were my credentials but they didn’t work. The gTwitter window says “Click on the Preferences button to enter username and password” but there is no such button. There’s a refresh, and a paint-brush icon in the “What are you doing?” text field, but no preferences button. I try right-clicking in the humungous top area where it says “Connection failed!” but nothing shows. The “Connection failed!” message is actually a button that loads a web page; no thanks. Clicking on the icon of a PC with two screens simply toggles the humungo-area between error message and a “Name:” label and nothing else. No sign of a “Preferences button” as advertised.

Turns out there’s an icon in the panel at the top of my screen that I have to right-click on to then get to a preferences menu! Grrr! Now since I paid the princely sum of $0.00 dollars for my Ubuntu setup, I don’t really have much recourse, but come on! It’s crapware like this that makes you wonder how Linux will ever win over the masses. I should have expected it, though, since gTwitter depends on Mono, which provides the .NET plague especially for Linux.

Oh, and now that I’ve just started Twitux one more time to confirm I got the error message right, the little bitch decides to work this time! Why on earth has it been such a right pain in the you-know-what for days on end now, and it’s only after I go flirting with another crappy Twitter client that it realises it has to put out to keep me? Crikey! Sometimes computers really piss me off!

I’m with Linus: KDE 4 sucks!

A week ago I posted an entry saying that I might use Linux, but I wouldn’t recommend it. A comment to that post by one “JD” said that this was because I have “made bad Linux choices”. Well, having decided to bite the bullet and give Ubuntu with GNOME a try, I’m inclined to agree. KDE might have kept a control-freak like me reasonably happy until now, but compared with Ubuntu’s GNOME, the 4.x variety is just rubbish! Even Linus himself thinks so.

About six weeks ago I switched from Mandriva 2009.0 to openSUSE 11.1, but the problems gradually mounted. Here’s a summary:

  • The hard disk would grind away like a ticking clock when downloading files or streaming video, and would sometimes even lock Firefox or another application until the disk operation had finished. I did try fiddling with swappiness and the I/O scheduler, but none of these made a difference in openSUSE. I hardly ever hear the disk in Ubuntu
  • I couldn’t play audio CDs
  • KDE 4.1.3 would occasionally just die with desktop icons disappearing then all my applications failing to respond; couldn’t even switch to a full terminal to log in
  • Dismounting removable media in Dolphin doesn’t show logical feedback of the change
  • YaST2, even though I said it was better than drakconf, eventually became irritating with its constant refreshing on startup
  • Special effects in KDE 4.x are lame compared to Compiz and aren’t as fast, either
  • The Kicker eventually annoyed me. Yes, I could have switched to the old style, but it just added to the feeling one gets when a product “just feels crap” all over
  • Audacious is available by default in Ubuntu’s repositories and I didn’t have to use a third-party Packman repo to get it
  • Power management for my Dell 2407WFP-HC monitor actually works in Ubuntu. In openSUSE I had to keep switching it off and on all the time if I didn’t want to waste power. After six weeks of this the button doesn’t work anymore and I’ve had to arrange an exchange with Dell
  • After installing VirtualBox in Ubuntu, I didn’t have to reboot for it to work. Not that this is major but I had to reboot in openSUSE for some reason
  • Auto-completion of emails in Kontact didn’t work. Now that I’ve switched to Thunderbird, things are better
  • K3b couldn’t eject burnt DVDs half the time

A problem that I’ve had for some time was the clipboard breaking whenever I ran VirtualBox but I eventually discovered that updating the guest additions to the current version fixed it (no more “ŸŸ” pasting only, yay!) so I can’t blame either Mandriva or openSUSE for that, but I think VirtualBox should detect old tools and notify the user.

So, I now have none of the above problems in Ubuntu 8.10 (I went with the 64-bit version, and so far, no hassles, apart from having to add a -vm switch to my Eclipse icon telling it which Java version to use for Aptana). That’s not to say that there aren’t some things I’d prefer were different in GNOME, so here goes:


  • Can’t drag/drop files onto buttons in the pathbar (have to open a tab first then drag to that tab)
  • I wish there was a List View size between 33% and 50%
  • No rubber-band file selection in List View (this has prevented me from using a GNOME-based distro for ages, but since everything else works so flawlessly in Ubuntu, this is a sacrifice worth making)
  • Pause/resume for file copy operations (and a bit more information) would be nice
  • Needs a way to hide some places in the left column (like partitions I haven’t bothered to format yet)
  • Beeps when deleting files – very annoying! (have to turn off default beep completely!)
  • Doesn’t show current directory size down the bottom


  • It would be nice to be able to see if a package was 32 or 64-bit in Synaptic
  • Ctrl+Tab instead of Ctrl+Alt+Page_Up/Down would be better in gedit
  • You can’t drag/drop files out of File Roller into Nautilus (or anywhere else)
  • Transmission is too basic, even by GNOME standards, and needs a pause/resume all menu item in the tray icon. Just an observation, since I’ve gone with Deluge anyway

Having got those off my chest, I’ve reached the point with KDE 4.x that even these GNOME annoyances are now minor in my view, and I’m prepared to live with them to get an operating system as near perfect as Ubuntu. Even the fonts seem to look better than in openSUSE or Mandriva, which always irked me in KDE. Maybe it was the distro’s choice of fonts, I don’t know; all I care about is the fact that there can be no question in my mind now that Ubuntu is the most popular Linux distribution for a reason: it just oozes quality! KDE and their distributions are going to have to do a damned fine job before they’ll entice me back now.

I might use Linux, but I wouldn’t recommend it

I’ve been using Linux as my one and only operating system at home for about 14 months now (12 months with Mandriva and the last two with openSUSE). During that time I’ve successfully managed to kick my dependency on proprietary software. Switching to was a major help because the need for MS Office was keeping me on Windows, and since Apple are too full of themselves to release a mid-range system without a monitor or an operating system that doesn’t treat me like a moron, Linux was the obvious choice. But I’d be lying if I said I was in computing heaven.

One of the things to really annoy me of late is the I/O scheduler in Linux, and anything involving disk activity. Copying large files across the network shouldn’t hang my applications for long periods of time. A friend in the know says that Windows prioritises the focused Window whereas Linux treats all tasks equally. Maybe this is why the I/O scheduler is now “completely fair queuing” by default. So I changed it to “deadline” for a while to see if that helped. It actually seemed to make Firefox hang even more, so I’m now trying “anticipatory” for a while, and so far, it might just feel better (but only time will tell). My next step will be to do away with a swap partition altogether. I have 2GB of memory for goodness sake, so Linux shouldn’t need to swap anything (even though I’ve set “vm.swappiness = 10” to try to discourage swapping).

The other day I copied some files to my brother’s very new 8GB flash drive using Dolphin in KDE 4.1.3 and let’s just say that I was getting some pretty dirty looks. The kind of look that says “*this* is how good Linux is? are you insane?” The files would seem to copy very quickly for a short while (up to about 8MB per second) but then the transfer rate would progressively slow down (under 1MB per second) to the point where it would seem to be doing nothing, then speed up again. My own 4GB USB seems fine, so perhaps Linux doesn’t like his brand (I’m sure he’d have noticed if Windows had trouble copying to it).

Today I don’t seem to be able to press Ctrl-Alt-Right or Left to switch virtual desktops, even though the KDE 4 “Personal Settings” window shows that they’re still set to these values. I finally decided to give virtual desktops a try the other day because I had so many windows open I couldn’t make sense of it all, and since I was doing some web development, including using The GIMP for graphical stuff, I couldn’t see the Toolbox or the Layers windows in the taskbar. Turns out The GIMP doesn’t show these down there (very handy, even though they’re fully-fledged windows and not like floating palettes in MS Windows).

What a bizarre beast this GIMP is, especially the openSUSE version, where the File menu isn’t on the Toolbox and instead appears at the top of an empty image window the first time you start it (and all other image windows subsequently). To top it off The GIMP’s selection saving is quite peculiar if you’re used to Photoshop (you have to save to channel, then, if you want that selection back again, right-click on the channel in the layers/channel window – that doesn’t appear in the taskbar – and choose Channel to Selection). Perhaps I should try “gimpshop” but right now I’m too annoyed to be bothered. And it won’t remember my recently-opened files, either.

Of course I could go on about the obligatory nuisance that is Adobe Flash. Actually, I think I will. I’m using the 64-bit version of openSUSE 11.1, and the admittedly alpha version of Adobe’s 64-bit flash player, but do you think that a web browser in Linux could still manage to play a simple applet without turning itself into a grey square again? By all accounts this 64-bit Linux flash player is supposed to be good, but as far as I can tell, it’s no better than before. Maybe Flash is just an abomination since it’s always been so, but surely in this day and age a simple sound-playing applet on can bloody well play a simple audio stream without kicking the bucket? And that’s another thing, finding all the annoying little packages that are required to play various media formats. Like previewing sound on, which appears to be a little flash applet. But since the whole world of media formats is one big sloppy orgy where everyone’s invited, including the dirty old troll who lives under the bridge out of town, it’s a frigging nightmare out there trying to get by.

That last slew of problems isn’t really Linux’s fault, but by George, you soon get to be intimately acquainted with them if you try to break free of Windows and all those evil Quicktime systray applets, Adobe updaters, pointless Java icons, and virus updates. Linux isn’t necessarily better in most respects, it just gives you different problems to deal with. The only good side is that you’ll at least have to adopt open file standards and your chances of being able to switch to a different OS one day will be greatly increased. If I’m not beholden to Windows any more then perhaps I could actually switch to Mac one day if Apple figured out how to create an OS acceptable to people with intellect. Like a decent Finder and the ability to really configure keyboard shortcuts (more than just redefining what the menu exposes). I’m sorry, Apple, but I simply must be able to press home/end to move my cursor to the beginning or end of the line. Ctrl-Left or Ctrl-Right is unacceptable. And forcing me to buy a system with a crappy screen with a locked-in hard drive and a crappy video card simply because I choose not to be price-gouged into a Mac Pro is no way to attract new customers (with a brain, that is).

I hadn’t intended to type all this tonight, but things have really been annoying me lately. Like my clipboard breaking every time I use VirtualBox, or not having back/forward mouse button support in Dolphin, or Pidgin periodically crashing whenever I receive a message from somebody (on MSN or XMPP), or not being able to read or play audio CDs, and Kontact not being able to auto-complete recent email addresses. I didn’t have any of these problems in Windows, but I did have a very healthy systray, and I had to have a virus scanner. Which is a bit of a deal breaker, really. Unless my problems mount up in Linux, I think I really do have the lesser of all evils. But it’s not such that I would be confident in recommending somebody switch to Linux. Assuming they’re stupid, I’ll just recommend they buy a Mac. And if their relationship with Windows has reached the point of separation, and they have a brain, they’ll just have to work around Linux’s issues themselves. I simply don’t have the time or the patience any more for this kind of crap.

21-Feb-2009: While I think of it, other things that are broken include K3b not being able to eject the DVD after burning, and the power management for my Dell 2407WFP-HC 24″ monitor not working, forcing me to switch it off all the time, to the point where the switch is now busted. Thank goodness for the “5 years advanced exchange” warranty on it. The default focus-stealing prevention is a bit too eager, I think. Clicking on a newly-inserted medium in the device notifier would load Dolphin, but wouldn’t actually focus the window or bring it to the front; you have to click on the glowing entry for it in the taskbar. If I just clicked on it in the device notifier, that generally means I want to open it! I just checked and the “Focus stealing prevention level” is set to “low” so I guess you have to choose “none” to fix this and really get annoyed like never before!

My kindgom for a perfect operating system

Just now I copied several gigabytes of data from one partition to another on my Windows XP Pro (64-bit edition) Intel Core 2 Duo E6400 machine. Having toyed around with Linux here and there over the years I’ve come to know that such a request isn’t beyond the realm of reasonableness. Linux can carry out this seemingly trivial task with aplomb but if you try to get Windows to do the same thing, old faithful shows just how crappy its inner workings truly are: try to double-click on Outlook in the systray and up pops a yellow balloon saying that it’s not responding, try to do anything else for that matter and one begins to realise that a stiff drink would have been the more prudent course of action.

I feel like a deer caught in the headlights of an on-coming car with no idea which way I’ll turn. All my favourite applications depend on Windows (with the exception of Firefox), but Linux, although it has a dream kernel capable of withstanding much abuse, doesn’t really offer much as far as quality in the user-space. There is no way that something so annoyingly-named that sports a GUI as haphazard as amaroK could ever replace iTunes, and I could never accept the spartan simplicity and barely-customisable Nautilus file manager or the flickery and slow bloatware that is Konqueror as replacements for what is, 99% of the time, a fast and zippy Windows explorer.

Don’t even get me started on Macs, either. Whilst Apple’s computer designs are works of art, the GUI is just a bit too freaky for an old Windows user like me, and with Home and End keys that don’t move the cursor to the beginning and end of the current line, I can’t see me ever accepting the one-size-fits-all-dummies feeling I get with OS X.

What would be nice is to keep the Windows XP shell but give it a decent kernel and hardware interface layer so that it feels responsive like Linux but still fits like an old glove. I know people still holding out with Windows 2000, so I guess I can still get away with using Windows XP for a couple more years, but even that can’t last forever. Windows Vista isn’t looking too appealing, either, with it’s Draconian (with more than a dash of monopolistic) licensing, a virgin networking stack that won’t be worth touching until at least service pack 2, a graphical shell that will bring new meaning to the word “bloatware”, and no decent “classic” interface. If Microsoft didn’t go all “focus-group” with Vista I might be able to put up with it, but as it is, I’m staying put – indefinitely!