---
title: "CFBundleLoadExecutableAndReturnError(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfbundleloadexecutableandreturnerror(_:_:)"
---

# CFBundleLoadExecutableAndReturnError(_:_:)

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>?>!) -> Bool
```

## Parameters

- `bundle`: The bundle to examine.
- `error`: Upon return, if an error occurs contains a CFError that describes the problem. Ownership follows the https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029.

## Return Value

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.

## See Also

### Loading and Unloading a Bundle

- [CFBundleIsExecutableLoaded(_:)](corefoundation/cfbundleisexecutableloaded(_:).md)
- [CFBundlePreflightExecutable(_:_:)](corefoundation/cfbundlepreflightexecutable(_:_:).md)
- [CFBundleLoadExecutable(_:)](corefoundation/cfbundleloadexecutable(_:).md)
- [CFBundleUnloadExecutable(_:)](corefoundation/cfbundleunloadexecutable(_:).md)
