Archive for the ‘Link’ Category

imageNamed is evil

Thursday, April 16th, 2009

Another iPhone programming gotcha, this one involving UIImage’s imageNamed: method. Worth noting for later.

How to calculate pi by throwing frozen hot dogs

Friday, February 20th, 2009

How to Calculate Pi by Throwing Frozen Hot Dogs

Believe it or not, of all the countless ways to approximate the most prolific irrational number in the universe, there are none quite as interesting or as surprisingly satisfying as throwing perfectly good food around your kitchen.

I haven’t tried this, but I will admit it looks extremely satisfying.

Multiple virtual pages in a UIScrollView with just 2 child views

Saturday, January 24th, 2009

Matt Gallagher posts on multiple virtual pages in a UIScrollView using just 2 child views:

The UIScrollView and UIPageControl in Cocoa Touch allow for user interfaces with multiple panning pages. The sample project that Apple provides (PageControl) keeps all child views for every page in a lazily loaded array. I’ll show you how you can implement this using just two child views, no matter how many virtual pages you wish to represent.

Caveat emptor on this technique, I suppose. You are going not going perfectly along Cocoa Touch’s grain. Probably best used when dealing with a large number of views.

I actually tried something like this before settling on a more basic approach like Apple’s PageControl sample code. But I ran into a problem which I thought was related, but turned out not to be: UITextView wouldn’t update when offscreen.

Turns out Matt has a solution to that, too:

These parts of the program exist because UITextView (used for the “Some text for Page X” display) don’t update if they are offscreen (in this case: in an offscreen page of the UIScrollView). This behavior isn’t a problem when the UITextView remains offscreen but becomes especially annoying when it is brought onscreen and still doesn’t update.

What a weight off my mind that is!

Full project and source included. Thanks Matt.

“My” vs “Your”

Friday, January 23rd, 2009

Small but nice iPhone application wording tip: “My” vs “Your”. I’d have fallen for that one for sure, but he’s right.

Apple stops requiring serial numbers for boxed iWork 09

Thursday, January 22nd, 2009

Ars Technica discovers an Apple support document explaining that boxed, retail copies of iWork 09 do not require a serial number. An interesting choice by Apple.

Setting up Subversion 1.5 on Xcode

Tuesday, January 20th, 2009

These instructions are for the Collabnet build, but you can use MacPorts build instead by replacing the path /opt/subversion/lib/ with /opt/local/lib/.

Lemon Team’s blog » Blog Archive » Setting up Subversion 1.5 on Xcode

Should Apple license OS X?

Thursday, January 15th, 2009

You can’t license to third parties and still compete with them.

Should Apple license OS X? No – mediabistro.com: MobileDevicesToday

Loving Xcode + iPhone SDK

Monday, December 15th, 2008

I’ve been full time on an iPhone project (more of a prototype, really) for one day, and I absolutely love it.

  • It’s simple and intuitive. Drop controls, set up outlets and actions.
  • You don’t have to fight the framework. It does what it does with a minimum of fuss.
  • A good UI is a focused UI, rather than one full of features. I love this style of thinking.

I’m less thrilled with Xcode’s documentation viewer. It feels like a really poor web browser that takes more of the screen for junk, runs in the same workspace so you can’t command-tab in and out of it. Just splitting it into a separate process would immediately improve it.

In about a day, I created four screens and linked them all together. That doesn’t sound horribly impressive, but it felt easy. Granted, I’ve previously spent a few hours figuring out UINavigationController, but things were actually simpler than I had understood. Finding things took a while, but they were generally hidden in plain sight. The few times I violated something in the runtime, the error message was simple, direct and accurate.

I do wish SQLite was a more recent version. I would love to use sqlite3_open_v2 in some of this code, especially the SQLITE_OPEN_READONLY flag.

Objective-J

Monday, December 15th, 2008

The Objective-J guys clear up some misconceptions. After reading this, I realize my initial rejection of this technology was based strictly on its name. It hasn’t sacrificed as much as the name implies. Definitely worth reading, and I’ll be checking it out further.

Fast iPhone scrolling with UITableView

Monday, December 15th, 2008

Fast Scrolling in Tweetie with UITableView by Loren Brichter, author of Tweetie:

Cutting to the chase, here’s the secret: One custom view per table cell, and do your own drawing. Sounds simple? That’s because it is. It’s actually simpler than dealing with a ton of subviews of labels and images, and it’s about a bzillion times faster (according to my informal tests).

This is not exactly relovuationary, but it is a nice summary and includes example code. This was perfect timing for me, as a custom table cell is one of the next steps in a project I’m working on. (Via Daring Fireball.)