Function

CFErrorCreate(_:_:_:_:)

Creates a new CFError object.

Declaration

func CFErrorCreate(_ allocator: CFAllocator!, _ domain: CFErrorDomain!, _ code: CFIndex, _ userInfo: CFDictionary!) -> CFError!

Parameters

allocator

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

domain

A CFString that identifies the error domain. If this reference is NULL or is otherwise not a valid CFString, the behavior is undefined.

code

A CFIndex that identifies the error code. The code is interpreted within the context of the error domain.

userInfo

A CFDictionary created with kCFCopyStringDictionaryKeyCallBacks and kCFTypeDictionaryValueCallBacks. The dictionary is copied with CFDictionaryCreateCopy(_:_:). If you do not want the userInfo dictionary, you can pass NULL, in which case an empty dictionary will be assigned.

Return Value

A new CFError object. Ownership follows the The Create Rule.

See Also