An iOS device uses one of a set of architectures, which include armv6
and armv7
. The Architectures build setting identifies the architectures for which your app is built. You have two options for specifying the value of this setting:
-
Standard. Produces an app binary with a common architecture, compatible with all supported iOS devices. This option generates the smallest app, but it may not be optimized to run at the best possible speed for all devices.
-
Optimized. Produces an app binary optimized for each supported iOS device. However, the build time is longer than when using the Standard option, and the app is also larger because multiple instruction sets are bundled into it.
Determining whether you’re compiling for a simulator
// Set hello to "Hello, <device or simulator>"! |
#if TARGET_IPHONE_SIMULATOR |
NSString *hello = @"Hello, iOS Simulator!"; |
#else |
NSString *hello = @"Hello, iOS device!"; |
#endif |
#if TARGET_OS_IPHONE |
#import <UIKit/UIKit.h> |
#else |
#import <Cocoa/Cocoa.h> |
#endif |