Mac OS X Reference Library Apple Developer
Search

Overview of SDK-Based Development

Apple makes SDKs available for specific versions of Mac OS X and iOS. Using these SDKs allows you to build against the headers and libraries of an operating system version other than the one you're running on. For example, you can build for Mac OS X version 10.4 while running on Mac OS X version 10.6. This chapter describes how SDK-based development works.

The Mac OS X SDKs are installed as part of the Xcode Essentials install package with Xcode 3.2 and later. Xcode release notes list the SDKs supported by each release. When developing for iOS, you always use an SDK downloaded from the iPhone Dev Center website.

You can take advantage of SDK-based development in these ways:

To develop software that can be deployed on, and take advantage of features from, different versions of Mac OS X or iOS, you specify which version (or SDK) of Mac OS X or iOS headers and libraries to build with. You can also specify the earliest Mac OS X or iOS system version on which the software will run. These concepts are described in “SDK Settings.”

Behavior Selection in Frameworks

As frameworks evolve through various releases, APIs are introduced or deprecated, and behaviors of existing APIs may occasionally change. Apple makes every effort to minimize changes that may cause incompatibilities, in some cases providing alternate behaviors based on the framework version. In other cases your code may need to determine the framework version and adjust accordingly.

As a backward-compatibility mechanism, Apple frameworks sometimes check for the version of the SDK an application was built against, and, if it is an older SDK, modify the behavior to be more compatible. This is done in cases where incompatibility problems are predicted or discovered.

Note: Most version-related behavior changes are listed in the framework release notes, but they are not necessarily described in the reference documentation. To understand the differences from one release to another, you must carefully review the release notes.

Typically, frameworks detect how an application was built by looking at the version of the system frameworks the application was linked against. Thus, as a result of relinking your application on a newer version or its SDK, you might notice different behaviors, some of which might cause incompatibilities. In these cases, because the application is being rebuilt, you should address these issues at the same time as well. For this reason, if you are doing a small incremental update of your application to address a few bugs, for example, it's usually best to continue building on the same build environment and libraries used originally, that is, against the original SDK.

In some cases, frameworks provide defaults (preferences) settings which can be used to get the old or new behavior, independent of what system an application was built against. Often these preferences are provided for debugging purposes only; in some cases the preferences can be used globally to modify the behavior of an application by registering the values (do it somewhere very early, with the NSUserDefaults method registerDefaults:).




Last updated: 2010-02-16

Did this document help you? Yes It's good, but... Not helpful...