Instance Method

preflight()

Returns a Boolean value indicating whether the bundle’s executable code could be loaded successfully.

Declaration

func preflight() throws

Parameters

error

On input, a pointer to an error object variable. On output, this variable may contain an error object indicating why the bundle’s executable could not be loaded. If no error would occur, this parameter is left unmodified. You may specify nil for this parameter if you are not interested in the error information.

Return Value

true if the bundle’s executable code could be loaded successfully or is already loaded; otherwise, false if the code could not be loaded.

Discussion

This method does not actually load the bundle’s executable code. Instead, it performs several checks to see if the code could be loaded and with one exception returns the same errors that would occur during an actual load operation. The one exception is the NSExecutableLinkError error, which requires the actual loading of the code to verify link errors.

For a list of possible load errors, see the discussion for the loadAndReturnError() method.

See Also

Loading Code from a Bundle

var executableArchitectures: [NSNumber]?

An array of numbers indicating the architecture types supported by the bundle’s executable.

func load() -> Bool

Dynamically loads the bundle’s executable code into a running program, if the code has not already been loaded.

func loadAndReturnError()

Loads the bundle’s executable code and returns any errors.

func unload() -> Bool

Unloads the code associated with the receiver.

var isLoaded: Bool

The load status of a bundle.

Mach-O Architecture

Constants describing the CPU types that a bundle’s executable code supports.