iOS Developer Library

Developer

CoreFoundation Framework Reference CFBundle Reference

Options
Deployment Target:

On This Page
Language:

CFBundle Reference

CFBundle allows you to use a folder hierarchy called a bundle to organize and locate many types of application resources including images, sounds, localized strings, and executable code. In OS X, bundles can also be used by CFM applications to load and execute functions from Mach-O frameworks. You can use bundles to support multiple languages or execute your application on multiple operating environments.

You create a bundle object using one of the CFBundleCreate... functions. CFBundle provides several functions for finding resources within a bundle. The CFBundleCopyResourceURL function returns the location of a resource of the specified name and type, and in the specified subdirectory. Use CFBundleCopyResourceURLForLocalization to restrict the search to a specific localization name. Use CFBundleCopyResourceURLsOfType to get the locations of all resources of a specified type.

CFBundle provides functions for getting bundle information, such as its identifier and information dictionary. Use the CFBundleGetIdentifier function to get the identifier of a bundle, and the CFBundleGetInfoDictionary function to get its information dictionary. The principal intended purpose for locating bundles by identifier is so that code (in frameworks, plugins, etc.) can find its own bundle.

You can also obtain locations of subdirectories in a bundle represented as CFURL objects. The CFBundleCopyExecutableURL function returns the location of the application’s executable. The functions CFBundleCopyResourceURL, CFBundleCopySharedFrameworksURL, CFBundleCopyPrivateFrameworksURL, CFBundleCopySharedSupportURL, and CFBundleCopyBuiltInPlugInsURL return the location of a bundle’s subdirectory containing resources, shared frameworks, private frameworks, shared support files, and plug-ins respectively.

Other functions are used to manage localizations. The CFBundleCopyLocalizedString and CFBundleCopyLocalizationsForURL functions return a localized string from a bundle’s strings file. The CFBundleCopyLocalizationsForPreferences function returns the localizations that CFBundle would prefer, given the specified bundle and user preference localizations.

Unlike some other Core Foundation opaque types with similar Cocoa Foundation names (such as CFString and NSString), NSBundle objects cannot be cast (“toll-free bridged”) to CFBundle objects.

Unlike NSBundle, which does not support unloading (because the Objective C runtime does not support the unloading of Objective C code), you can unload CFBundle objects.

CFBundleGetFunctionPointerForName and related calls automatically load a bundle if it is not already loaded. When the last reference to the CFBundle object is released and it is finally deallocated, then the code will be unloaded if it is still loaded and if the executable is of a type that supports unloading. If you keep this in mind, and if you make sure that everything that uses the bundle keeps a retain on the CFBundle object, then you can just use the bundle naturally and never have to worry about when it is loaded and unloaded.

On the other hand, if you want to manually manage when the bundle is loaded and unloaded, then you can use CFBundleLoadExecutable and CFBundleUnloadExecutable—although this technique is not recommended. These functions force immediate loading and unloading of the executable (if it has not already been loaded/unloaded, and in the case of unloading if the executable is of a type that supports unloading). If you do this, then the code calling CFBundleUnloadExecutable is responsible for making sure that there are no remaining references to anything in the bundle's code before it is unloaded. In the previous approach, by contrast, this responsibility can be distributed to the individual code sections that use the bundle, by making sure that each one keeps its own retain on the CFBundle object.

One further point about CFBundle reference counting: if you are taking the first approach, but do not actually wish the bundle’s code to be unloaded (as is often the case), or if you are taking the second approach of manually managing the unloading yourself, then in many cases you do not actually have to worry about releasing a CFBundle object. CFBundle instances are uniqued, so there is only one CFBundle object for a given bundle, and rarely are there so many bundles being considered at once that the memory usage for CFBundle objects would be significant. There are cases in which a process could create CFBundle objects for potentially an unlimited number of bundles, and such processes would wish to balance retains and releases carefully, but such cases are likely to be rare.

Note that it is best to compile any unloadable bundles with the flag -fno-constant-cfstrings—see Bundle Programming Guide for more details.

Functions

  • Creates a CFBundle object.

    Declaration

    Swift

    func CFBundleCreate(_ allocator: CFAllocator!, _ bundleURL: CFURL!) -> CFBundle!

    Objective-C

    CFBundleRef CFBundleCreate ( CFAllocatorRef allocator, CFURLRef bundleURL );

    Parameters

    allocator

    The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    bundleURL

    The location of the bundle for which to create a CFBundle object.

    Return Value

    A CFBundle object created from the bundle at bundleURL. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Returns NULL if there was a memory allocation problem. May return an existing CFBundle object with the reference count incremented. May return NULL if the bundle doesn’t exist at bundleURL (see Discussion).

    Discussion

    Once a bundle has been created, it is cached; the bundle cache is flushed only periodically. CFBundleCreate does not check that a cached bundle still exists in the filesystem. If a bundle is deleted from the filesystem, it is therefore possible for CFBundleCreate to return a cached bundle that has actually been deleted.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Searches a directory and constructs an array of CFBundle objects from all valid bundles in the specified directory.

    Declaration

    Swift

    func CFBundleCreateBundlesFromDirectory(_ allocator: CFAllocator!, _ directoryURL: CFURL!, _ bundleType: CFString!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCreateBundlesFromDirectory ( CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType );

    Parameters

    allocator

    The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    directoryURL

    The location of the directory to search for valid bundles.

    bundleType

    The abstract type of the bundles to locate and create. The type is expressed as a filename extension, such as bundle. Pass NULL to create CFBundle objects for bundles of any type.

    Return Value

    A CFArray object containing CFBundle objects created from the contents of the specified directory. Returns an empty array if no bundles exist at directoryURL, and NULL if there was a memory allocation problem. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    The array returned by this function will not contain stale CFBundle references.

    Special Considerations

    The The Create Rule in Memory Management Programming Guide for Core Foundation applies both to the array returned and to the bundles in the array. In order to properly dispose of the returned value, you must release the array and any bundles returned in the array.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array containing all of the bundles currently open in the application.

    Declaration

    Swift

    func CFBundleGetAllBundles() -> CFArray!

    Objective-C

    CFArrayRef CFBundleGetAllBundles ( void );

    Return Value

    A CFArray object containing CFBundle objects for each open bundle in the application. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Special Considerations

    This function is potentially expensive and not thread-safe. It’s best used for debugging or other diagnostics purposes rather than as part of the main execution path of production code.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Locate a bundle given its program-defined identifier.

    Declaration

    Swift

    func CFBundleGetBundleWithIdentifier(_ bundleID: CFString!) -> CFBundle!

    Objective-C

    CFBundleRef CFBundleGetBundleWithIdentifier ( CFStringRef bundleID );

    Parameters

    bundleID

    The identifier of the bundle to locate. Note that identifier names are case-sensitive.

    Return Value

    A CFBundle object, or NULL if the bundle was not found. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    For a bundle to be located using its identifier, the bundle must already have been loaded. The principal purpose for locating bundles by identifier is for code in frameworks or plugins to find its own bundle.

    Bundle identifiers are created by entering a value for the key CFBundleIdentifier in the bundle’s Info.plist file.

    To ensure uniqueness, you should create bundle identifiers with the form of reverse-DNS naming style package names, such as com.MyCompany.MyApp.bundleName.

    Special Considerations

    If a bundle object is created and the bundle file structure later deleted from the filesystem, this function will still return the original bundle object.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an application’s main bundle.

    Declaration

    Swift

    func CFBundleGetMainBundle() -> CFBundle!

    Objective-C

    CFBundleRef CFBundleGetMainBundle ( void );

    Return Value

    A CFBundle object representing the application’s main bundle, or NULL if it is not possible to create a bundle. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    CFBundle creates a main bundle whenever it possibly can, even for unbundled apps. There are a few situations in which it is not possible, so you should check the return value against NULL, but this happens only in exceptional circumstances.

    For an explanation of the main bundle, see Locating and Opening Bundles in Bundle Programming Guide.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Obtains information about the load status for a bundle’s main executable.

    Declaration

    Swift

    func CFBundleIsExecutableLoaded(_ bundle: CFBundle!) -> Boolean

    Objective-C

    Boolean CFBundleIsExecutableLoaded ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    true if bundle’s main executable has been loaded, otherwise false.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a Boolean value that indicates whether a given bundle is loaded or appears to be loadable.

    Declaration

    Swift

    func CFBundlePreflightExecutable(_ bundle: CFBundle!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>) -> Boolean

    Objective-C

    Boolean CFBundlePreflightExecutable ( CFBundleRef bundle, CFErrorRef *error );

    Parameters

    bundle

    The bundle to examine.

    error

    Upon return, if an error occurs contains a CFError that describes the problem. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Return Value

    true if bundle is loaded or upon inspection appears to be loadable, otherwise false.

    Discussion

    If this function returns true, this does not mean that the bundle is definitively loadable, since it may fail to load due to link errors or other problems not readily detectable.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Loads a bundle’s main executable code into memory and dynamically links it into the running application.

    Declaration

    Swift

    func CFBundleLoadExecutable(_ bundle: CFBundle!) -> Boolean

    Objective-C

    Boolean CFBundleLoadExecutable ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle whose main executable you want to load.

    Return Value

    true if the executable was successfully loaded, otherwise false.

    Discussion

    You should typically try to avoid using this function, but instead use CFBundleGetFunctionPointerForName and related functions since these make memory management of the bundle easier.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a Boolean value that indicates whether a given bundle is loaded, attempting to load it if necessary.

    Declaration

    Swift

    func CFBundleLoadExecutableAndReturnError(_ bundle: CFBundle!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>) -> Boolean

    Objective-C

    Boolean CFBundleLoadExecutableAndReturnError ( CFBundleRef bundle, CFErrorRef *error );

    Parameters

    bundle

    The bundle to examine.

    error

    Upon return, if an error occurs contains a CFError that describes the problem. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Return Value

    If bundle is already loaded, returns true. If bundle is not already loaded, attempts to load bundle; if that attempt succeeds returns true, otherwise returns false.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Unloads the main executable for the specified bundle.

    Declaration

    Swift

    func CFBundleUnloadExecutable(_ bundle: CFBundle!)

    Objective-C

    void CFBundleUnloadExecutable ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle whose main executable you want to unload.

    Discussion

    You should typically try to avoid using this function, but instead use CFBundleGetFunctionPointerForName and related functions since these make management of the bundle easier (when the last reference to the CFBundle object is released, and it is finally deallocated, then the code will be unloaded if it is still loaded, and if the executable is of a type that supports unloading).

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Closes an open resource map for a bundle.

    Declaration

    Swift

    func CFBundleCloseBundleResourceMap(_ bundle: CFBundle!, _ refNum: CFBundleRefNum)

    Objective-C

    void CFBundleCloseBundleResourceMap ( CFBundleRef bundle, CFBundleRefNum refNum );

    Parameters

    bundle

    The bundle whose resource map is referenced by refNum.

    refNum

    The reference number for a resource map to close.

    Discussion

    You open a resource map using either CFBundleOpenBundleResourceFiles or CFBundleOpenBundleResourceMap.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the location of a resource contained in the specified bundle.

    Declaration

    Swift

    func CFBundleCopyResourceURL(_ bundle: CFBundle!, _ resourceName: CFString!, _ resourceType: CFString!, _ subDirName: CFString!) -> CFURL!

    Objective-C

    CFURLRef CFBundleCopyResourceURL ( CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName );

    Parameters

    bundle

    The bundle to examine.

    resourceName

    The name of the requested resource.

    resourceType

    The abstract type of the requested resource. The type is expressed as a filename extension, such as jpg. Pass NULL if resourceName is the complete name of the file you’re looking for, including any extension.

    subDirName

    The name of the subdirectory of the bundle’s resources directory to search. Pass NULL to search the standard CFBundle resource locations.

    Return Value

    A CFURL object describing the location of the requested resource, or NULL if the resource cannot be found. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    For example, if a bundle contains a subdirectory WaterSounds that includes a file Water1.aiff, you can retrieve the URL for the file using:

    • CFBundleCopyResourceURL(bundle, CFSTR("Water1"), CFSTR("aiff"), CFSTR("WaterSounds"));

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the location of a resource contained in the specified bundle directory without requiring the creation of a CFBundle object.

    Declaration

    Swift

    func CFBundleCopyResourceURLInDirectory(_ bundleURL: CFURL!, _ resourceName: CFString!, _ resourceType: CFString!, _ subDirName: CFString!) -> CFURL!

    Objective-C

    CFURLRef CFBundleCopyResourceURLInDirectory ( CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName );

    Parameters

    bundleURL

    The bundle to examine.

    resourceName

    The name of the requested resource.

    resourceType

    The abstract type of the requested resource. The type is expressed as a filename extension, such as jpg. Pass NULL if you don’t need to search by type.

    subDirName

    The name of the subdirectory of the bundle’s resources directory to search. Pass NULL to search the standard CFBundle resource locations.

    Return Value

    A CFURL object describing the location of the requested resource, or NULL if the resource cannot be found. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This function provides a means to obtain package information for a bundle without first creating a bundle. However, since CFBundle objects cache search results, it is faster to create a CFBundle object if you need to repeatedly access resources.

    Note that searches are case-sensitive, even on file systems (such as HFS+) that are not case sensitive with regards to file names.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Assembles an array of URLs specifying all of the resources of the specified type found in a bundle.

    Declaration

    Swift

    func CFBundleCopyResourceURLsOfType(_ bundle: CFBundle!, _ resourceType: CFString!, _ subDirName: CFString!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyResourceURLsOfType ( CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName );

    Parameters

    bundle

    The bundle to examine.

    resourceType

    The abstract type of the resources to locate. The type is expressed as a filename extension, such as jpg.

    subDirName

    The name of the subdirectory of the bundle’s resources directory to search. Pass NULL to search the standard CFBundle resource locations.

    Return Value

    A CFArray object containing CFURL objects of the requested resources. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    Note that searches are case-sensitive, even on file systems (such as HFS+) that are not case sensitive with regards to file names.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array of CFURL objects describing the locations of all resources in a bundle of the specified type without needing to create a CFBundle object.

    Declaration

    Swift

    func CFBundleCopyResourceURLsOfTypeInDirectory(_ bundleURL: CFURL!, _ resourceType: CFString!, _ subDirName: CFString!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory ( CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName );

    Parameters

    bundleURL

    The location of a bundle to examine.

    resourceType

    The abstract type of the resources to locate. The type is expressed as a filename extension, such as jpg.

    subDirName

    The name of the subdirectory of the bundle’s resources directory to search. Pass NULL to search the standard CFBundle resource locations.

    Return Value

    A CFArray object containing the CFURL objects of the requested resources. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This function provides a means to obtain an array containing the locations of all of the requested resources without first creating a CFBundle object. However, since CFBundle objects cache search results, it is faster to create a CFBundle object if you need to repeatedly access resources.

    Note that file names are case-sensitive, even on file systems (such as HFS+) that are not case sensitive with regards to file names.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the location of a localized resource in a bundle.

    Declaration

    Swift

    func CFBundleCopyResourceURLForLocalization(_ bundle: CFBundle!, _ resourceName: CFString!, _ resourceType: CFString!, _ subDirName: CFString!, _ localizationName: CFString!) -> CFURL!

    Objective-C

    CFURLRef CFBundleCopyResourceURLForLocalization ( CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName );

    Parameters

    bundle

    The bundle to examine.

    resourceName

    The name of the requested resource.

    resourceType

    The abstract type of the resource to locate. The type is expressed as a filename extension, such as jpg.

    subDirName

    The name of the subdirectory of the bundle’s resources directory to search. Pass NULL to search the standard CFBundle resource locations.

    localizationName

    The name of the localization. This value should correspond to the name of one of the bundle's language-specific resource directories without the .lproj extension. (This parameter is treated literally: If you pass "de", the function will not match resources in a German.lproj directory in the bundle.)

    Return Value

    The location of a localized resource in bundle, or NULL if the resource could not be found. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    Note that file names are case-sensitive, even on file systems (such as HFS+) that are not case sensitive with regards to file names.

    You should typically have little reason to use this function (see Getting the Current Language and Locale)—CFBundle’s interfaces automatically apply the user’s preferences to determine which localized resource files to return in response to a programmatic request. See also CFBundleCopyBundleLocalizations for how to determine what localizations are available

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array containing copies of the URL locations for a specified bundle, resource, and localization name.

    Declaration

    Swift

    func CFBundleCopyResourceURLsOfTypeForLocalization(_ bundle: CFBundle!, _ resourceType: CFString!, _ subDirName: CFString!, _ localizationName: CFString!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization ( CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName );

    Parameters

    bundle

    The bundle to examine.

    resourceType

    The abstract type of the resources to locate. The type is expressed as a filename extension, such as jpg.

    subDirName

    The name of the subdirectory of the bundle’s Resources directory to search. Pass NULL to search the standard CFBundle resource locations.

    localizationName

    The name of the localization. This value should correspond to the name of one of the bundle's language-specific resource directories without the .lproj extension. (This parameter is treated literally: If you pass "de", the function will not match resources in a German.lproj directory in the bundle.)

    Return Value

    A CFArray object containing copies of the requested locations. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    Note that file names are case-sensitive, even on file systems (such as HFS+) that are not case sensitive with regards to file names.

    You should typically have little reason to use this function (see Getting the Current Language and Locale)—CFBundle’s interfaces automatically apply the user’s preferences to determine which localized resource files to return in response to a programmatic request. See also CFBundleCopyBundleLocalizations for how to determine what localizations are available

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Opens the non-localized and localized resource files (if any) for a bundle in separate resource maps.

    Declaration

    Swift

    func CFBundleOpenBundleResourceFiles(_ bundle: CFBundle!, _ refNum: UnsafeMutablePointer<CFBundleRefNum>, _ localizedRefNum: UnsafeMutablePointer<CFBundleRefNum>) -> Int32

    Objective-C

    SInt32 CFBundleOpenBundleResourceFiles ( CFBundleRef bundle, CFBundleRefNum *refNum, CFBundleRefNum *localizedRefNum );

    Parameters

    bundle

    The bundle whose resource map you want to open.

    refNum

    On return, the reference number of the non-localized resource map.

    localizedRefNum

    On return, the reference number of the localized resource map.

    Return Value

    An error code. The function returns 0 (noErr) if successful. If the bundle contains more than one resource file, the function returns an error code only if none was opened. The most common error is resFNotFound, but the function may also pass through other errors returned from the Resource Manager.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Opens the non-localized and localized resource files (if any) for a bundle in a single resource map.

    Declaration

    Swift

    func CFBundleOpenBundleResourceMap(_ bundle: CFBundle!) -> CFBundleRefNum

    Objective-C

    CFBundleRefNum CFBundleOpenBundleResourceMap ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle whose resource map you want to open.

    Return Value

    A distinct reference number for the resource map.

    Discussion

    Creates and makes current a single read-only resource map containing the non-localized and localized resource files. If this function is called multiple times, it opens the files multiple times and returns distinct reference numbers for each. Use CFBundleCloseBundleResourceMap to close a resource map.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array containing a bundle’s localizations.

    Declaration

    Swift

    func CFBundleCopyBundleLocalizations(_ bundle: CFBundle!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyBundleLocalizations ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    An array containing bundle’s localizations. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    The array returned by this function is typically passed as a parameter to either the CFBundleCopyPreferredLocalizationsFromArray or CFBundleCopyLocalizationsForPreferences function.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a localized string from a bundle’s strings file.

    Declaration

    Swift

    func CFBundleCopyLocalizedString(_ bundle: CFBundle!, _ key: CFString!, _ value: CFString!, _ tableName: CFString!) -> CFString!

    Objective-C

    CFStringRef CFBundleCopyLocalizedString ( CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName );

    Parameters

    bundle

    The bundle to examine.

    key

    The key for the localized string to retrieve. This key will be used to look up the localized string in the strings file. Typically the key is identical to the value of the localized string in the development language.

    value

    A default value to return if no value exists for key.

    tableName

    The name of the strings file to search. The name should not include the strings filename extension. The case of the string must match that of the file name, even on file systems (such as HFS+) that are not case sensitive with regards to file names

    Return Value

    A CFString object that contains the localized string. If no value exists for key, returns value unless value is NULL or an empty string, in which case key is returned instead. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This is the base function from which the other localized string macros are derived. In general you should not use this function because the genstrings development tool only recognizes the macro version of this call when generating strings files. See CFCopyLocalizedString for details on how to use these macros.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Given an array of possible localizations and preferred locations, returns the one or more of them that CFBundle would use, without reference to the current application context.

    Declaration

    Swift

    func CFBundleCopyLocalizationsForPreferences(_ locArray: CFArray!, _ prefArray: CFArray!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyLocalizationsForPreferences ( CFArrayRef locArray, CFArrayRef prefArray );

    Parameters

    locArray

    An array of possible localizations to search.

    prefArray

    An array of preferred localizations. If NULL, the user’s actual preferred localizations will be used.

    Return Value

    An array containing the localizations that CFBundle would use. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This is not the same as CFBundleCopyPreferredLocalizationsFromArray, because that function takes the current application context into account. To determine the localizations that another application would use, apply this function to the result of CFBundleCopyBundleLocalizations.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array containing the localizations for a bundle or executable at a particular location.

    Declaration

    Swift

    func CFBundleCopyLocalizationsForURL(_ url: CFURL!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyLocalizationsForURL ( CFURLRef url );

    Parameters

    url

    The location of a bundle’s localizations.

    Return Value

    An array containing the localizations available at url. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    For a directory URL, this is equivalent to calling the CFBundleCopyBundleLocalizations function on the corresponding bundle. For a plain file URL representing an unbundled application, this will attempt to determine its localizations using the kCFBundleLocalizationsKey and kCFBundleDevelopmentRegionKey keys in the dictionary returned by CFBundleCopyInfoDictionaryForURL, or a vers resource if those are not present.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Given an array of possible localizations, returns the one or more of them that CFBundle would use in the current application context.

    Declaration

    Swift

    func CFBundleCopyPreferredLocalizationsFromArray(_ locArray: CFArray!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyPreferredLocalizationsFromArray ( CFArrayRef locArray );

    Parameters

    locArray

    An array of possible localizations.

    Return Value

    A subset of locArray that CFBundle would use in the current application context. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    You can obtain locArray using the CFBundleCopyBundleLocalizations function.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Searches the default strings file Localizable.strings for the string associated with the specified key.

    Declaration

    Objective-C

    CFStringRef CFCopyLocalizedString ( CFStringRef key, const char *comment );

    Parameters

    key

    The development language version of the string. This string is used as the search key to locate the localized version of the string.

    comment

    A comment to provide the translators with contextual information necessary for proper translation.

    Return Value

    The localized version of the requested string. Returns key if no value corresponding to key is found. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This is a macro variant of CFBundleCopyLocalizedString for use with the genstrings tool.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

  • Searches the specified strings file for the string associated with the specified key.

    Declaration

    Objective-C

    CFStringRef CFCopyLocalizedStringFromTable ( CFStringRef key, CFStringRef tableName, const char *comment );

    Parameters

    key

    The development language version of the string. This string is used as the search key to locate the localized version of the string.

    tableName

    The name of the strings file to search. The name should not include the strings filename extension. The case of the string must match that of the file name, even on file systems (such as HFS+) that are not case sensitive with regards to file names

    comment

    A comment to provide the translators with contextual information necessary for proper translation.

    Return Value

    The localized version of the requested string, or key if no value corresponding to key is found. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This is a macro variant of CFBundleCopyLocalizedString for use with the genstrings tool.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

  • Returns a localized version of the specified string.

    Declaration

    Objective-C

    CFStringRef CFCopyLocalizedStringFromTableInBundle ( CFStringRef key, CFStringRef tableName, CFBundleRef bundle, const char *comment );

    Parameters

    key

    The development language version of the string. This string is used as the search key to locate the localized version of the string.

    tableName

    The name of the strings file to search. The name should not include the strings filename extension. The case of the string must match that of the file name, even on file systems (such as HFS+) that are not case sensitive with regards to file names

    bundle

    The bundle to examine.

    comment

    A comment to provide the translators with contextual information necessary for proper translation.

    Return Value

    The localized version of the requested string, or key if no value corresponding to key is found. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This is a macro variant of CFBundleCopyLocalizedString for use with the genstrings tool.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

  • Returns a localized version of a localization string.

    Declaration

    Objective-C

    CFStringRef CFCopyLocalizedStringWithDefaultValue ( CFStringRef key, CFStringRef tableName, CFBundleRef bundle, CFStringRef value, const char *comment );

    Parameters

    key

    The development language version of the string. This string is used as the search key to locate the localized version of the string.

    tableName

    The name of the strings file to search. The name should not include the strings filename extension.

    bundle

    The bundle to examine.

    value

    The default value for the requested localization string.

    comment

    A comment to provide the translators with contextual information necessary for proper translation.

    Return Value

    The localized version of the requested string. If no value corresponding to key is found, returns value, unless value is NULL or an empty string, in which case key is returned instead. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This is a macro variant of CFBundleCopyLocalizedString for use with the genstrings tool.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

  • Returns a data pointer to a symbol of the given name.

    Declaration

    Swift

    func CFBundleGetDataPointerForName(_ bundle: CFBundle!, _ symbolName: CFString!) -> UnsafeMutablePointer<Void>

    Objective-C

    void * CFBundleGetDataPointerForName ( CFBundleRef bundle, CFStringRef symbolName );

    Parameters

    bundle

    The bundle to examine.

    symbolName

    The name of the symbol you are searching for.

    Return Value

    A data pointer to a symbol named symbolName in bundle, or NULL if symbolName cannot be found. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a C array of data pointer to symbols of the given names.

    Declaration

    Swift

    func CFBundleGetDataPointersForNames(_ bundle: CFBundle!, _ symbolNames: CFArray!, _ stbl: UnsafeMutablePointer<UnsafeMutablePointer<Void>>)

    Objective-C

    void CFBundleGetDataPointersForNames ( CFBundleRef bundle, CFArrayRef symbolNames, void *stbl[] );

    Parameters

    bundle

    The bundle to examine.

    symbolNames

    A CFArray object containing CFString objects representing the symbol names to search for.

    stbl

    A C array into which this function stores the data pointers for the symbols specified in symbolNames. The array contains NULL for any names in symbolNames that cannot be found.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a pointer to a function in a bundle’s executable code using the function name as the search key.

    Declaration

    Swift

    func CFBundleGetFunctionPointerForName(_ bundle: CFBundle!, _ functionName: CFString!) -> UnsafeMutablePointer<Void>

    Objective-C

    void * CFBundleGetFunctionPointerForName ( CFBundleRef bundle, CFStringRef functionName );

    Parameters

    bundle

    The bundle to examine.

    functionName

    The name of the function to locate.

    Return Value

    A pointer to a function in a bundle’s executable code, or NULL if functionName cannot be found. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    Calling this function will cause the bundle’s code to be loaded if necessary.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Constructs a function table containing pointers to all of the functions found in a bundle’s main executable code.

    Declaration

    Swift

    func CFBundleGetFunctionPointersForNames(_ bundle: CFBundle!, _ functionNames: CFArray!, _ ftbl: UnsafeMutablePointer<UnsafeMutablePointer<Void>>)

    Objective-C

    void CFBundleGetFunctionPointersForNames ( CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[] );

    Parameters

    bundle

    The bundle to examine.

    functionNames

    A CFArray object containing a list of the function names to locate.

    ftbl

    A C array into which this function stores the function pointers for the symbols specified in functionNames. The array contains NULL for any names in functionNames that cannot be found.

    Discussion

    Calling this function causes the bundle’s code to be loaded if necessary.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s plug-in.

    Declaration

    Swift

    func CFBundleGetPlugIn(_ bundle: CFBundle!) -> CFPlugIn!

    Objective-C

    CFPlugInRef CFBundleGetPlugIn ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    The plug-in for bundle. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the location of a bundle.

    Declaration

    Swift

    func CFBundleCopyBundleURL(_ bundle: CFBundle!) -> CFURL!

    Objective-C

    CFURLRef CFBundleCopyBundleURL ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    A CFURL object describing the location of bundle, or NULL if the specified bundle does not exist. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the bundle’s development region from the bundle’s information property list.

    Declaration

    Swift

    func CFBundleGetDevelopmentRegion(_ bundle: CFBundle!) -> CFString!

    Objective-C

    CFStringRef CFBundleGetDevelopmentRegion ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    A CFString object containing the name of the bundle’s development region. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the bundle identifier from a bundle’s information property list.

    Declaration

    Swift

    func CFBundleGetIdentifier(_ bundle: CFBundle!) -> CFString!

    Objective-C

    CFStringRef CFBundleGetIdentifier ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    A CFString object containing the bundle’s identifier, or NULL if none was specified in the information property list. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s information dictionary.

    Declaration

    Swift

    func CFBundleGetInfoDictionary(_ bundle: CFBundle!) -> CFDictionary!

    Objective-C

    CFDictionaryRef CFBundleGetInfoDictionary ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    A CFDictionary object containing the data stored in the bundle’s information property list (the Info.plist file). This is a global information dictionary. CFBundle may add extra keys to this dictionary for its own use. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    You should typically use CFBundleGetValueForInfoDictionaryKey rather than retrieving values directly from the info dictionary because the function will return localized values if any are available. Use CFBundleGetInfoDictionary only if you know that the key you are interested in will not be localized.

    To retrieve an info dictionary without creating a CFBundle object, see CFBundleCopyInfoDictionaryInDirectory and CFBundleCopyInfoDictionaryForURL.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s localized information dictionary.

    Declaration

    Swift

    func CFBundleGetLocalInfoDictionary(_ bundle: CFBundle!) -> CFDictionary!

    Objective-C

    CFDictionaryRef CFBundleGetLocalInfoDictionary ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    A dictionary containing the key-value pairs in bundle’s localized information dictionary (from the InfoPlist.strings file for the current locale). Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a value (localized if possible) from a bundle’s information dictionary.

    Declaration

    Swift

    func CFBundleGetValueForInfoDictionaryKey(_ bundle: CFBundle!, _ key: CFString!) -> AnyObject!

    Objective-C

    CFTypeRef CFBundleGetValueForInfoDictionaryKey ( CFBundleRef bundle, CFStringRef key );

    Parameters

    bundle

    The bundle to examine.

    key

    The key for the value to return.

    Return Value

    A value corresponding to key in bundle’s information dictionary. If available, a localized value is returned, otherwise the global value is returned. Ownership follows the The Get Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    You should use this function rather than retrieving values directly from the info dictionary (Info.plist) because CFBundleGetValueForInfoDictionaryKey returns localized values if any are available (from the InfoPlist.strings file for the current locale).

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s information dictionary.

    Declaration

    Swift

    func CFBundleCopyInfoDictionaryInDirectory(_ bundleURL: CFURL!) -> CFDictionary!

    Objective-C

    CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory ( CFURLRef bundleURL );

    Parameters

    bundleURL

    A CFURL object describing the location of a bundle.

    Return Value

    A CFDictionary object containing the information dictionary for a bundle located at bundleURL. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    This function provides a means to obtain an information dictionary for a bundle without first creating a CFBundle object.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the information dictionary for a given URL location.

    Declaration

    Swift

    func CFBundleCopyInfoDictionaryForURL(_ url: CFURL!) -> CFDictionary!

    Objective-C

    CFDictionaryRef CFBundleCopyInfoDictionaryForURL ( CFURLRef url );

    Parameters

    url

    A CFURL object describing the location of a file.

    Return Value

    A CFDictionary object containing url’s information dictionary. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    For a directory URL, this is equivalent to CFBundleCopyInfoDictionaryInDirectory. For a plain file URL representing an unbundled application, this function will attempt to read an information dictionary either from the (__TEXT, __info_plist) section of the file (for a Mach-O file) or from a plst resource.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s package type and creator.

    Declaration

    Swift

    func CFBundleGetPackageInfo(_ bundle: CFBundle!, _ packageType: UnsafeMutablePointer<UInt32>, _ packageCreator: UnsafeMutablePointer<UInt32>)

    Objective-C

    void CFBundleGetPackageInfo ( CFBundleRef bundle, UInt32 *packageType, UInt32 *packageCreator );

    Parameters

    bundle

    The bundle to examine.

    packageType

    On return, the four-letter type code for the bundle. This is APPL for applications, FMWK for frameworks, and BNDL for generic bundles. Or a more specific type code for generic bundles.

    packageCreator

    On return, the four-letter “creator” code for the bundle.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s package type and creator without having to create a CFBundle object.

    Declaration

    Swift

    func CFBundleGetPackageInfoInDirectory(_ url: CFURL!, _ packageType: UnsafeMutablePointer<UInt32>, _ packageCreator: UnsafeMutablePointer<UInt32>) -> Boolean

    Objective-C

    Boolean CFBundleGetPackageInfoInDirectory ( CFURLRef url, UInt32 *packageType, UInt32 *packageCreator );

    Parameters

    url

    The location of a bundle.

    packageType

    On return, the four-letter type code for the bundle. This is APPL for applications, FMWK for frameworks, and BNDL for generic bundles. Or a more specific type code for generic bundles.

    packageCreator

    On return, the four-letter “creator” code for the bundle.

    Return Value

    true if the package type and creator were found, otherwise false.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array of CFNumbers representing the architectures a given bundle provides.

    Declaration

    Swift

    func CFBundleCopyExecutableArchitectures(_ bundle: CFBundle!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyExecutableArchitectures ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine.

    Return Value

    If the bundle's executable exists and is a Mach-O file, returns an array of CFNumbers whose values are integers representing the architectures the file provides. Possible values are listed in Architecture Types. If the executable is not a Mach-O file, returns NULL. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns an array of CFNumbers representing the architectures a given URL provides.

    Declaration

    Swift

    func CFBundleCopyExecutableArchitecturesForURL(_ url: CFURL!) -> CFArray!

    Objective-C

    CFArrayRef CFBundleCopyExecutableArchitecturesForURL ( CFURLRef url );

    Parameters

    url

    The URL to examine.

    Return Value

    For a directory URL, if the bundle's executable exists and is a Mach-O file, returns an array of CFNumbers whose values are integers representing the architectures the URL provides. For a plain file URL representing an unbundled executable, returns the architectures it provides if it is a Mach-O file. Possible values are listed in Architecture Types. If there is no bundle executable or if the executable is not a Mach-O file, returns NULL. Ownership follows the The Create Rule in Memory Management Programming Guide for Core Foundation.

    Discussion

    For a directory URL, this is equivalent to calling CFBundleCopyExecutableArchitectures on the corresponding bundle.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns a bundle’s version number.

    Declaration

    Swift

    func CFBundleGetVersionNumber(_ bundle: CFBundle!) -> UInt32

    Objective-C

    UInt32 CFBundleGetVersionNumber ( CFBundleRef bundle );

    Parameters

    bundle

    The bundle to examine. The bundle’s version number can be number or a string of the standard form “2.5.3d5”.

    Return Value

    A vers resource style version number. If it is a string, it is automatically converted to the numeric representation, where the major version number is restricted to 2 BCD digits (in other words, it must be in the range 0-99) and the minor and bug fix version numbers are each restricted to a single BCD digit (0-9).

    Discussion

    This function is only supported for the vers resource style version numbers. Where other version number styles—namely X, or X.Y, or X.Y.Z—are used, you can use CFBundleGetValueForInfoDictionaryKey with the key kCFBundleVersionKey to extract the version number as a string from the bundle’s information dictionary.

    Some version numbers of the form X, X.Y, and X.Y.Z may work with this function, if X <= 99, Y <= 9, and Z <= 9. Thus a version number 76.5.4 will work, but 76.12 will not work.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • Returns the type identifier for the CFBundle opaque type.

    Declaration

    Swift

    func CFBundleGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID CFBundleGetTypeID ( void );

    Return Value

    The type identifier for the CFBundle opaque type.

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

Data Types

Miscellaneous

  • Type that identifies a distinct reference number for a resource map.

    Declaration

    Swift

    typealias CFBundleRefNum = Int16

    Objective-C

    #if __LP64__ typedef int CFBundleRefNum; #else /* __LP64__ */ typedef SInt16 CFBundleRefNum; #endif /* __LP64__ */

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

  • A reference to a CFBundle object.

    Declaration

    Swift

    typealias CFBundleRef = CFBundle

    Objective-C

    typedef struct __CFBundle *CFBundleRef;

    Import Statement

    import CoreFoundation

    Availability

    Available in iOS 2.0 and later.

Constants

Miscellaneous

  • Standard keys found in a bundle’s information property list file.

    Declaration

    Swift

    let kCFBundleInfoDictionaryVersionKey: CFString! let kCFBundleExecutableKey: CFString! let kCFBundleIdentifierKey: CFString! let kCFBundleVersionKey: CFString! let kCFBundleDevelopmentRegionKey: CFString! let kCFBundleNameKey: CFString! let kCFBundleLocalizationsKey: CFString!

    Objective-C

    const CFStringRef kCFBundleInfoDictionaryVersionKey; const CFStringRef kCFBundleExecutableKey; const CFStringRef kCFBundleIdentifierKey; const CFStringRef kCFBundleVersionKey; const CFStringRef kCFBundleDevelopmentRegionKey; const CFStringRef kCFBundleNameKey; const CFStringRef kCFBundleLocalizationsKey;

    Constants

    • kCFBundleInfoDictionaryVersionKey

      kCFBundleInfoDictionaryVersionKey

      The version of the information property list format.

      Available in iOS 2.0 and later.

    • kCFBundleExecutableKey

      kCFBundleExecutableKey

      The name of the executable in this bundle (if any).

      Available in iOS 2.0 and later.

    • kCFBundleIdentifierKey

      kCFBundleIdentifierKey

      The bundle identifier.

      Available in iOS 2.0 and later.

    • kCFBundleVersionKey

      kCFBundleVersionKey

      The version number of the bundle.

      Available in iOS 2.0 and later.

    • kCFBundleDevelopmentRegionKey

      kCFBundleDevelopmentRegionKey

      The name of the development language of the bundle.

      When CFBundle looks for resources, the fallback is to look in the lproj whose name is given by the kCFBundleDevelopmentRegionKey in the Info.plist file. You must, therefore, ensure that a bundle contains an lproj with that exact name containing a copy of every localized resource, otherwise CFBundle cannot guarantee the fallback mechanism will work.

      Available in iOS 2.0 and later.

    • kCFBundleNameKey

      kCFBundleNameKey

      The human-readable name of the bundle.

      This key is often found in the InfoPlist.strings since it is usually localized.

      Available in iOS 2.0 and later.

    • kCFBundleLocalizationsKey

      kCFBundleLocalizationsKey

      Allows an unbundled application that handles localization itself to specify which localizations it has available.

      Available in iOS 2.0 and later.

    Import Statement

  • Constants that identify executable architecture types.

    Declaration

    Swift

    var kCFBundleExecutableArchitectureI386: Int { get } var kCFBundleExecutableArchitecturePPC: Int { get } var kCFBundleExecutableArchitectureX86_64: Int { get } var kCFBundleExecutableArchitecturePPC64: Int { get }

    Objective-C

    enum { kCFBundleExecutableArchitectureI386 = 0x00000007, kCFBundleExecutableArchitecturePPC = 0x00000012, kCFBundleExecutableArchitectureX86_64 = 0x01000007, kCFBundleExecutableArchitecturePPC64 = 0x01000012 };

    Constants

    • kCFBundleExecutableArchitectureI386

      kCFBundleExecutableArchitectureI386

      Specifies the 32-bit Intel architecture.

      Available in iOS 2.0 and later.

    • kCFBundleExecutableArchitecturePPC

      kCFBundleExecutableArchitecturePPC

      Specifies the 32-bit PowerPC architecture.

      Available in iOS 2.0 and later.

    • kCFBundleExecutableArchitectureX86_64

      kCFBundleExecutableArchitectureX86_64

      Specifies the 64-bit Intel architecture.

      Available in iOS 2.0 and later.

    • kCFBundleExecutableArchitecturePPC64

      kCFBundleExecutableArchitecturePPC64

      Specifies the 64-bit PowerPC architecture.

      Available in iOS 2.0 and later.

    Import Statement