Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
555 views
in Technique[技术] by (71.8m points)

iphone - How to target 4.2 version with XCode 4

I've upgraded to XCode 4 which comes with the 4.3 version of the SDK.

But we'd like to make sure our app runs on devices that have 4.2 and later, not just 4.3.

Is there a setting in XCode that can be configured so we don't have to force upgrade everyone just yet?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There are two settings in the project settings that affect which platforms you app will support:

  • Base SDK : The name or path of the base SDK being used during the build.
  • Deployment Target : Code will load on this and later versions of iOS.

The first sets the SDK that you link against and the second sets the iOS versions that your app will support. It is important to understand this note on the Deployment Target setting:

Framework APIs that are unavailable in earlier versions will be weak-linked; your code should check for null function pointers or specific system versions before calling newer APIs.

So if you are using any APIs that only exist in 4.3, make sure those frameworks are weak-linked and that your code checks the iOS version before using those APIs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...