Creates a CFBundle object.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
CFBundle Ref CFBundleCreate(CFAllocator Ref allocator, CFURLRef bundleURL);
Parameters
allocator
The allocator to use to allocate memory for the new object. Pass
NULL
ork
to use the current default allocator.CFAllocator Default bundleURL
The location of the bundle for which to create a CFBundle object.
Return Value
A CFBundle object created from the bundle at bundle
. Ownership follows the The Create Rule.
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 bundle
(see Discussion).
Discussion
Once a bundle has been created, it is cached; the bundle cache is flushed only periodically. CFBundle
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 CFBundle
to return a cached bundle that has actually been deleted.