Steve Jobs

Last Wednesday, I discussed Chapter 7 of “Men Against Fire“. That chapter ends with a discussion of leadership, closing with the admonition that “It is not always possible to lead from behind”. At the time, I wasn’t quite sure what to do with this discussion, aside from pulling out a pair of striking passages. After some reflection, however, I think there is a valuable, general lesson to be drawn from Marshall’s thoughts on wartime leadership: “horses for courses”, in short.

Continue reading

Posted in Jack Handy | Comments Off

SQLite Gotcha

Working with SQLite on the iPhone, I ran across a strange (to me, anyway) interaction between prepared statements and transactions. This interaction (which I’m not sure it would be fair to call a “bug”) was causing DB writes to take effect only while my app was running, without being committed to disk. This, of course, was not the desired behaviour, but fortunately it could be corrected.

Continue reading

Posted in iPhone | Comments Off

Mark Webber

Congratulations to Mark Webber on his first F1 victory. I’ve been a fan of Mark’s since his inaugural F1 race, when he took a Minardi from 18th on the grid to a points finish in 5th. He’s in a tough fight with his teammate this season, but looks to finally have a car with a reasonable chance of winning a constructor’s – and even, just possibly, a driver’s – championship.

It seems fitting that his success comes with Red Bull Racing, the successor to the (late, lamented, at least by this Blue Oval fan) Jaguar Racing outfit for which he drove in 2003 and 2004.

Posted in Jack Handy | Comments Off

iPhone and SQLite

Although Apple’s documentation doesn’t make too much of the point, the iPhone offers full support for SQLite. If you’re comfortable with DBs, this can be a timesaver, even for some problems for which a DB might seem like overkill. (In iPhone OS 3.0 and up, Core Data is also supported.)

This post offers a good introduction to the topic. Pay careful attention to the discussion of the libsqlite3.0.dylib file, as it’s the only really non-obvious part of getting started.

Incidentally, is it just me, or are there a disproportionate number of Aussie iPhone developers/resources?

Posted in iPhone | Comments Off

Shiny Red Buttons (6.1)

Editorial note: This is the first of several posts covering shiny button backgrounds. I’m breaking the topic up in order to keep the posts shorter. Also, today’s post is up a little late, due to another project. My apologies.

If you look carefully at the glossy buttons used in native iPhone apps (e.g. the Stopwatch Clock app, or the “slide to unlock” control) you’ll see that they have a rather complex border. They appear to sit in a “well” comprised of a several pixel wide “moat”, surrounded by a one pixel wide “edge”. Both the moat and the edge have gradients applied to them.

Continue reading

Posted in iPhone | Comments Off

Table Details

When using hierarchical table views (e.g. with a Navigation Controller) to enter or edit information, the proper sequence of UI events can be surprisingly subtle. Consider what happens when you edit a phone number in the Contacts app:

  • You click on the number (in the “Edit” mode of the “Info” view)
  • The row highlights blue
  • The “Edit Phone” view scrolls in from the right
  • You change the number, and press “Save”
  • The “Edit” mode of the “Info” view scrolls in from the left
  • The row highlight fades out

Note that when the “Edit” mode of the “Info” view scrolls in from the left, the edited number field shows the new value, before the highlight fades out. This is a tricky effect to achieve.

Continue reading

Posted in iPhone | Comments Off

Focus! Focus!

Test resultsYesterday, I made reference to the contentVerticalAlignment property of UIControls. Upon further examination, it may not be such a good idea to use this property, for a somewhat surprising reason. If you look carefully at the screenshot to the left (click for a full-size view) you’ll see that the non-first-responder UITextFields are blurry.

Continue reading

Posted in iPhone | Comments Off

Vertical Alignment

Editorial Note: I’d been planning to write about glossy button backgrounds today, but I appear to be buttoned out. I’ll pick the topic up again by Friday, but, for now, something lighter. And shorter.

Let’s say you want to adjust (horizontal) text alignment in a UITextField. No problem – you use the textAlignment property. Now, suppose you want to control vertical text alignment in that field …. there doesn’t seem to be a property for that.

Well, there is, but it’s buried in the UIControl ancestor class. The contentVerticalAlignment property is the one you want. I suppose it’s not unreasonable to put this property here, but since it took me a while to find it, I thought I’d mention it.

Posted in iPhone | Comments Off

Bob Dylan

It’s easy to go overboard with Bob Dylan fandom – Dylanology, etc. – and it’s true both that a little Bob goes a long way, and that most of his songs Make No Damn Sense Whatsoever, but surely we’d be a poorer culture without opening lines such as:

Oh God said to Abraham, “Kill me a son”
Abe says, “Man, you must be puttin’ me on”
God say, “No.” Abe say, “What?”
God say, “You can do what you want Abe, but
The next time you see me comin’ you better run”

and

They’re selling postcards of the hanging
They’re painting the passports brown
The beauty parlor is filled with sailors
The circus is in town

Posted in Jack Handy | Comments Off

Fourth of July

The Declaration of Independence is not without interest. It’s not much longer than a blog post – and even features what looks to be an early form of the bullet point – but a lot more important.

Posted in Jack Handy | Comments Off