iAds & Deprecation Purgatory

You didn't heed the deprecation warning correctly did you?

My recent update of Tube Status unleashed some savage reviews & angry users and I was at a loss to explain why it had all gone horribly wrong for some but not others. Turns out I’d been tripped up by the simple deprecation of static property in the iAds framework…I am now in deprecation purgatory whilst the fixed version is in approval again (update: Apple turned the approval around in less than 24 hours, very impressive!).

iAds was introduced in iOS4 and later updated in iOS4.2, probably for iPad. The property

ADBannerContentSizeIdentifier320x50

was introduced in iOS4 then quickly deprecated in 4.2, being replaced by

ADBannerContentSizeIdentifierPortrait

All very pedestrian and makes perfect sense. I had decided that Tube Status would move to iOS4 for a number of reasons, but because I am not completely evil I also decided the minimum iOS version you could run Tube Status 3.0 on would be iOS4.0. I set the Base SDK = iOS4.2 and the iOS Deployment Target = 4.0.

At some point during development, playing around with the deployment target I discovered ADBannerContentSizeIdentifier320x50 was now a deprecated property.

No worries, quick read of the docs confirmed this and in my case the property to use now is ADBannerContentSizeIdentifierPortrait, find, replace move on to something more interesting. Spot the problem? For users on iOS4.0 & 4.1 I have just introduced a property for them that literally doesn’t exist in the iAds framework they have installed, result is an ugly crash. I must be stupid yes? Maybe, but stupidity aside one is not warned of this potential problem in Xcode, remember my build settings:

Base SDK = iOS4.2
iOS Deployment Target = 4.0

iOS4 & 4.1 users were angry

And I have used ADBannerContentSizeIdentifierPortrait (a version 4.2 property). As far as Xcode is concerned it doesn’t seem to evaluate starting properties against your minimum deployment target (irrespective of whether the framework is weak linked or not). No warning is given.

The moral of the story is that had I tested on any 4.0 or 4.1 device I would have discovered the problem well before shipping. 20 other people also tested before release and it flew through Apples approval process as well. Which goes to show how easy something like this can slip through and why testing on the minimum & latest deployment target is a must.

This entry was posted in apple, ipad, iPhone, iPod Touch. Bookmark the permalink.

2 Responses to iAds & Deprecation Purgatory

  1. robertjoseph says:

    App seems to be unable to update tube status. (Just hangs on “updating”). This started a few weeks ago. (Using 2nd generation iPhone with os4).
    Should I reinstall?
    Thanks for your help
    Regards
    Robert

  2. Malcolm Barclay says:

    Hi Robert,

    This sounds like an install problem. Can you follow this reinstall procedure. Ensure the latest OS installed on your iPhone first. Plug in to iTunes and click ‘Check for Update’. Then…

    1. Uninstall the app (press the icon until it shakes, then tap the ‘x’)
    2. Shut down (COMPLETE POWER OFF OF THE DEVICE, not sleep mode)
    3. Restart
    4. Reinstall app directly from ‘App Store’ (i.e use the App Store app on the phone, not a sync with iTunes.)

    You will lose any previously saved favourites.

    Regards,
    Malcolm

Leave a Reply