Why I find Objective C a hard language to learn

Lots of methods get an NSIndexPath as the argument, and all the sample code that I’ve seen gets the current row out of the indexPath object using [indexPath row]. Sometimes they get the section number using [indexPath section]. Ok, that seems simple enough. Now look at the documentation for this class, which is what you see if you use the XCode research assistant to show you the documents:

NSIndexPath Class Reference.

I cannot for the life of me see any way to extract the information that you get the current row using “row” out of that document. It’s not there. No, instead you have to figure out that UIKit has added some methods to NSIndexPath, and find ‘row” and “section” in a different document called “NSIndexPath UIKit Additions”. Isn’t that intuitive?

iPhone app

I haven’t written much about my iPhone app, but now that I have some time on my hands, I’ve put some more time into it.

I’ve been watching the Stanford iPhone course on iTunes U. They had a couple of successful iPhone app developers come in to give lectures, which were very useful. One of the things that stuck with me was an insistence that you prototype the user interface. They recommended sketches, but my sketches are horrible so I decided to try Photoshop. I grabbed this Photoshop template which is really great except it’s missing some important UI elements, like the symbol that looks like a “Do Not Enter” sign that iPhone apps use to indicate “delete this element”. In spite of that, I managed to mock up some screens, get some feedback, try running through a few scenarios, etc. You can see my current iteration on my gallery. Keep in mind that I don’t think I’ve got the correct fonts or font colours for the standard iPhone UI, but I mostly did it for looking at layout and program flow.

As well as that, I was working out the data storage, including the SQLite tables and stuff. I was trying to figure out how to get the lazy load the data and only keep what I need in memory. That’s when I started reading about the 3.0 software and the Core Data API. It seemed like exactly what I need, so I paid my registration fee and downloaded 3.0 to see if it will be as useful as it appears. One unfortunate side-effect – all the code I’ve typed in from the iPhone book I’ve been working through has tons of “setText is deprecated” warnings. Oh well.

Geek Heaven!

I know I’m supposed to be saving money until I get a new job, but I’ve ordered my ticket to the StackOverflow Dev Day in Toronto. Right now my only question is how late to wait before ordering my SO Reputation t-shirt so my rep is in the right ballpark when I wear it there.

I think the networking opportunities there will be awesome. I wonder if I should print out a bunch of resumes?

That’s odd

Last week some time some people on the LUGOR (Linux Users Group Of Rochester) mailing list were discussing Time Warner’s new tiered bandwidth pricing plan and naturally the question came up “how do I measure the bandwidth I’m using if I have multiple computers behind my router”. Somebody mentioned the “Tomato” firmware for Linksys WRT54G routers as having some nifty functionality, including graphs of bandwidth use, so I thought I’d give it a go.

Last Wednesday I downloaded the firmware and attempted to install it, but each time I got a message telling me that the firmware upload had failed. So I thought nothing of it. Sunday, my router rebooted because of UPS problems. Monday, I noticed that I couldn’t reach my home web server. So Monday night when I got home from kayaking I logged into the admin console for my router, only to find it’s now running Tomato. Tomato evidently managed to grab all my settings from the old firmware except the port forwarding. But I quickly fixed that, and now I’m getting nifty graphs of bandwidth use. Nifty.

I don’t need this.

Last night was the third Sunday in four where my UPS has woken me up with beeping. Each time, it seems to suddenly decide that while the load is unchanged, and the charge percentage is unchanged, the projected lifetime in the event of a power loss has suddenly changed from 100 minutes to 0 minutes. This is more than likely an indication that the batteries are failing, and it’s time to replace them. The UPS does some sort of self test once a week, and evidently this one does these tests at 1:30am on Sundays. There doesn’t seem to be any way to turn off these tests or reschedule them.

I spent a hell of a lot on this UPS, wanting one with a lot of capacity and which had replaceable batteries, because my previous one hadn’t let me know that the batteries were getting old until our power went out one day and the charge hadn’t lasted long enough to get down to the computer room to shut down my servers. I can’t remember what I paid for it, but the current equivalent model retails for around $600, so it was probably up in that range. Replacement batteries seem to be around $50 with $20 shipping, and plus then I’d have three small lead acid batteries to dispose of somehow.

On the other hand, I’ve migrated a lot of the things I wanted a Linux server for from my home to my colo box. I’m starting to question if I even need a 24×7 server in the home. Maybe rather than spending all that money on a UPS, I should just move the last remaining things (the mail server and the personal web pages) to the colo box and shut down my home server. It’s a shame to trash a $600 UPS for want for $60 in batteries, but maybe I can eBay it.