Archive for the ‘iPhone’ Category

Simulator vs iPhone

Wednesday, July 7th, 2010

Ah.  That’s the problem.  I’ve been chasing a bug lately, it works fine in the sim but the feature doesn’t work on the iPhone. Turns out the simulator isn’t a perfect simulation.  We all know about the obvious stuff: no GPS for example.  But on application termination with iOS 4 there’s a little detail that can be important:An app exits on the simulator by first calling first applicationWillResignActive then calling applicationDidEnterBackground on the application’s delegate.But on the phone, we get first applicationDidEnterBackground, then applicationWillTerminate. In both cases this is when the home button is pressed. If you kill the app with the debugger then it’s just killed and none of these gets called at all.This isn’t a big deal till you’ve got some data that you want the app’s delegate to save when the app goes background or is quitting.  This is also one of the behaviors that changes in iOS4 too with the advent of multitasking.  Unfortunately the Apple docs on the application delegate don’t go into the order the delegate calls are made, nor the variations between the sim and phone.And, since the test phone is a 3G, it may behave differently on a multitasking phone like a 3GS or 4 model.Sometimes, testing is the only way to find out what really happens.

My First iPhone App

Sunday, May 16th, 2010

Well, not my first.  But my first attempt at a publicly-released app in the iTunes app store.  This is a small app about the BP oil spill in the Gulf of Mexico.  It was a fast development process of only a week, with a one-day beta process.

Thanks to my beta testers (family) for their quick response and helpful comments.  I chose beta testers for their ability to respond quickly due to the short product cycle.  My wife did wonderful work in alpha testing, content editing, and UI testing.  This app is significantly approved by her contributions.

The iTunes submission process isn’t really as clear as I would like.  That’s ok for me, I’ve worked it out now and understand the process.  It does raise the bar some though!  But it’s been a long week and I’m glad it’s done now.Now I’ll see what the Apple app store approval process is like.  I’ve been hearing it’s faster and easier than it used to be, that’s good news.   I’ll let you know what happens.

NSTimer bug?

Monday, May 10th, 2010

In my iPhone programming I’ve been trying to use NSTimer’s scheduledTimerWithTimeInterval:target:selector:userInfo:repeats method.  I’ve enventually figured out that calling it with a nil value for userInfo gets and “bad access” error in the debugger when the timer pops.  It’s documented to accept a nil value, but only seems to work with a non-nil value.

So pass something there, even if you don’t need it

Pet peeve: getting directions

Thursday, October 29th, 2009

In the vein if my last post about older ways of thinking, there are three ways of giving directions.

First, to not give specific directions but only general ones.  Assume that anyone finding your house or place of business is familiar enough with the area to know the building or major roads that you don’t have to be precise.

When we lived in New Hampshire this was common.  I once got the directions, “Go south on highway 1, pass the first Dunkin’ Doughnuts, then turn left a half mile before the old Channel Hardware store.”  For some reason most of the directions I got in New Hampshire and Massachusetts included Dunkin’ Doughnuts.  Those stores were common enough to be landmarks.  But my favorite part was to “turn a half mile before” that old store.  That store went out of business before we moved to the area and the sign was long gone. Basically you had to already know where you were going to get there!

Second, to give specific directions including turns, streets you’ll see before your turns, and streets you’ll see if you miss your turns.  In short, good directions.   Good directions that are great if you don’t have a map or a GPS with a moving map.  And are a waste of time with those devices.

I have Google Earth (version 5.1, the latest) installed on my computers.  I have a GPS with a moving map in one car, and we have iPhones with GPS and moving maps with us in any case.  Ten minutes of discussion on directions is wasting everyone’s time.  And if it’s from your memory, it may not be right either.

What I want is a third way to give directions: Note the destination address, any issues not clear on maps (funny turn lanes, oddball corners, etc) and note parking information at the destination.  I want the stuff that’s not clear on the GPS moving map.  The whole turn-by-turn directions are not that useful.