The same thing going down…

We’re probably pushing a beta of the book today or tomorrow… once I write a few grafs of flow here and there. The monster debugging/performance chapter is splitting into two chapters, which made for a little reworking here and there… I added a section to debugging on how to spot and resolve missing #import / #include / @class statements and forgotten framework linkage, plus a “Joe Asks” explaining why you might want to use Shark since it’s Simulator-only (it’s a little simpler to find stuff in Shark than in Instruments’ CPU profiler, though nobody denies that Instruments is far, far more comprehensive a profiling tool).

Also working on an article for Mystery Client, which was pitched as being somewhat similar to the URL Loading System stuff in the Network I/O chapter when the book looked dead. So I’ve had to revise the article to make it more different from the book, which was actually a good exercise. The article will offer a URL downloader that flips between web view and source view. It’s a pretty cute demo actually.

When I was trying to come up with a different example for the article, I started writing an RSS client. It works great, but the overhead of parsing the XML and populating the table kind of buries the URL stuff, which was the original point. I may take an hour over the weekend or next week to convert that into a sample code freebie on one of my various blogs (maybe O’Reilly Digital Media, with pointers to the book and a link from here… I don’t know yet…)

Next in the book… I don’t know if I’m taking on one of the easier chapters from the remaining list (accelerometer, address book), or starting into the challenging media chapter. I also need to work my share of the errata. There are a few of the examples that were written really early in the SDK betas and don’t really suit iPhone programming practices today, so those need to get cleaned up. Specifically, the “flipping preferences” demo provided its own flip code whereas Xcode now gives you a template for that, and the file i/o example builds more of its navigation GUI in code than is necessary. I also need to re-read the file and network chapters to make sure I haven’t spent too much time on old-fashioned tight-loop byte-reading, since the patterns throughout Cocoa (and even Core Foundation) make it clear that the callback-driven approaches are much preferred. That’s a case where I came into the book with biases and experiences from other languages and platforms, and need to really make sure I’m presenting Cocoa qua Cocoa.

One more thing: at some point, I need to parachute into the table chapter (written by a co-author) and provide the “how to design table cells in IB and use them in your app without wasting memory or CPU” recipe (which is what my first article for Mystery Client is about). For anyone who needs the secret now, my approach is: put the cell in its own NIB, write a factory class to find the cell with loadNibNamed:owner:options:, use the factory where you used to use alloc and initWithFrame:reuseIdentifier: (ie, when you couldn’t dequeue an already-existing cell from the table). There are probably other approaches, but I’m very happy with this recipe.

I’m not going to Chicago for iPhone Tech Talks… just got my “sorry, turns out we’re full after all” note yesterday. No big loss; I just wish they’d post the damn WWDC videos already (or just the slides, ferstevessake!). I didn’t take notes because I counted on being able to go back and look that stuff up. Thwart!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.