Question

We have a project that runs fine on OS4 but we're having problems getting it to run on iPad 3.2.

Base SDK is 4.0 and Deployment target is 3.2.

The code crashes on the iPad simulator (and device) before it has even started, with the error

"Data Formatters temporarily unavailable"

It seems to run okay if I take 2 lines out...

AVURLAsset* asset = [AVURLAsset URLAssetWithURL:assetURL options:options];

and

export = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetPassthrough];

I branch according to what OS is present so that these lines never get reached when on a 3.2 device (I know they are OS4), but just them being there at all makes the thing crash out before it even begins.

Any ideas? Cheers

Was it helpful?

Solution

If those lines are never reached on the iPad, you may be encountering a problem due to not weak-linking the AVFoundation framework (and potentially others). Because AVURLAsset and AVAssetExportSession don't exist as symbols in 3.2, your application may be crashing on startup on that older OS.

I describe how to weak-link a framework in response to a similar problem in this answer.

OTHER TIPS

First of all, "Data Formatters temporarily unavailable" is a GDB message, it's not why your application crashes. More information regarding this message can be found here.

You need to check the availability of classes during runtime (not compile-time) if you want to write code that runs on both iOS 3.0 and 4.0.

You can do this using the NSClassFromString function like this:

if (NSClassFromString(@"AVURLAsset")) {
    // 4.0 code using AVURLAsset goes here
} else {
    // 3.0 code goes here
}

Try this (or similar):

#if __IPHONE_OS_VERSION_MIN_REQUIRED < 40000
  // code for iOS below 4.0
#else
  // code for iOS 4.0
#endif

Stolen from this question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top