If it isn’t fixed, break it

iPhone SDK 3.0 has lots of lovely stuff… none of which I can currently discuss here, due to the NDA. At least now we know that the NDA will go away when this version gets a public release.

Suffice to say that there will be some significant new writing to be done before the iPhone SDK Development book is final. We’ll also have to be extra careful to watch for stuff we’ve written that’s either obsolete or has more attractive alternatives in 3.0. I could very well lose a whole chapter, all for the folly of making the book better. On the other hand, it’s a valuable opportunity to get the book right for 3.0, without fighting against copies already in the channel.

I’ve spent much of the day reworking the File I/O chapter. Again. This was the first one I wrote for the book, back around iPhone SDK beta 5 when there were painful IB bugs that required code workarounds that I never thought to remove from the book until much later, when people downloaded the example source and said “what the heck is this?”

The chapter’s always been a bit of a bugbear, in that it’s the first chapter that’s not about the UIKit GUI components, and instead uses the GUI to create a sample app that exercises the NSFileManager, input and output streams, etc. We’ve had a lot of pushback from readers, some of which I think comes from being pushed out of a comfort zone of Interface Builder “clicky draggy” and instead expecting the reader to know by now the basics of IB-Xcode interaction (e.g., if you intend to read a value from a text field, you’ll need to declare and connect an IBOutlet, etc.).

But on the other hand, I keep finding archaic code in the example, left over from those earliest betas of the SDK, some even pre-dating the availability of IB in the SDK, which is why there’s more creation of objects in code than we’d typically use today.

This was also before a lot of iPhone UI conventions got spelled out. Prior to today, you could select a row in the “directory contents” table and click a delete button. As it turns out, this is explicitly against the iPhone HIG, which says that table rows should not maintain selection state, and instead need to take an immediate action when tapped. So, in the next beta, the swipe gesture will delete rows, and since I don’t need to use the “row tapped” event to hold a selection for possible deletion, that can now become “navigate to subdirectory or file”, which I had assigned to an ugly accessory button.

So, not glamorous work, but it is making the chapter better. I’m also being more explicit about what the reader needs to write and where. The first drafts of this chapter were written without a lot of knowledge of its context, and integrating it with the rest of the book is going to take a little more time.

Next up, I’m not sure if I apply a similar overhaul to the database chapter (also highly minimal in the clicky-draggy department, but hasn’t gotten many complaints), start in on my AUGraph article, or start in on iPhone 3.0 APIs.

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.