Simulator vs iPhone

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.

When is a sunny day IFR?

July 7th, 2010

When the haze is thick in summer.  In the Washington DC area lately the temperatures have been very high, that’s cooking the crud that we humans put in the air and making haze.  This morning several major local airports were marginal VFR (MVFR) on what’s otherwise a great day due to this haze.IFR; it’s not just for rainy days!I’m not flying today, but I was up recently on a hazy day but where the visibility is better than today’s is.  I was just up for a regular self-guided currency exercise. I didn’t cross the Blue Ridge because I couldn’t see the other side.I did my stalls, slow flight, flight at minimum controllable airspeed, steep turns, turns around a point, and some compass turns just to keep up the practice on basic exercises.  It’s not that I need to do stalls or any of the above in normal flying, but that practicing them hones skills and reminds me of where the edges of the plane’s capabilities - and mine - are located.Oh, and it can be fun too.  I got slow flight to 50 mph (not knots - I have an older plane) with engine power up, a steep angle, and the stall horn blaring loudly.

My First iPhone App

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?

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