2

Now My app is using Assets library Frameworks which is only available on iOS 4.0 and later for multi-choosing photos, but I want my app runs on devices with iOS 3.2.

Could I link the Assets library dynamically? If so I could judge whether the iOS SDK version is earlier than 4.0, if earlier I would use UIImagePickerController instead of Assets library, if later I could load Assets library dynamically and implement multi-choosing using it.

1 Answer 1

1

You can set the framework to weak linking. When you select a framework in Xcode 4 you can switch the target membership in the right pane between optional / required.

You should read Adding Runtime Checks for Newer Symbols in the docs.

Basically you can check the runtime availability of a class :

if ([INeedThisClass class]) ...  // SDK 4.2 and later

or

Classe ineedthis = NSClassFromString(@"INeedThisClass");   // SDK 4.1
if (ineedthis) ...
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, Tom. Your answer is really helpful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.