views:

24

answers:

2
To support OS 3.x, please set Base SDK to iPhone Device 4.0 and iPhone OS Deployment Target to iPhone OS 3.x. Extra linker flags may be needed if NSConcreteGlobalBlock and UIBackgroundTaskInvalid runtime error occur under 3.x.
The linker flags are:
-weak_framework UIKit
-weak_library /usr/lib/libSystem.B.dylib

EDIT: im still getting the same build error, even after linking: cl.ly/c69ca3f8a336d7e41256

A: 
  • Double-click on your target or application in Xcode to open the Info window

  • Switch to the "Build" tab

  • Add "-weak_framework UIKit -weak_library /usr/lib/libSystem.B.dylib" to "Other Linker Flags" (under "Linking")

kovpas
im still getting the same build error, even after linking: http://cl.ly/c69ca3f8a336d7e41256
Sheehan Alam
+1  A: 

Not sure what causes the build problems. But both NSConcreteGlobalBlock and UIBackgroundTaskInvalid make me think you encounter problems in an app that uses background processing and still needs to run on 3.x.

Personally I've never seen these problems, and I've certainly never weak-linked UIKit or libSystem. Even in apps that work perfectly fine on 3.x and support 4.0 features like blocks and background audio I have not needed the suggested fixes.

The general rule to accomplish this: do not use blocks in code that might be executed on 3.x. So only start backgrounding in - (void)applicationDidEnterBackground:(UIApplication *)application. This delegate method doesn't exist in the 3.x protocol and will therefore not be called. If you would use blocks in methods that are called on 3.x it will cause a crash.

Joris Kluivers