---
title: "CFPropertyListCreateData(_:_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfpropertylistcreatedata(_:_:_:_:_:)"
---

# CFPropertyListCreateData(_:_:_:_:_:)

Returns a CFData object containing a serialized representation of a given property list in a specified format.

## Declaration

```swift
func CFPropertyListCreateData(_ allocator: CFAllocator!, _ propertyList: CFPropertyList!, _ format: CFPropertyListFormat, _ options: CFOptionFlags, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<CFData>!
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new data object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `propertyList`: The property list to write out.
- `format`: A CFPropertyListFormat constant to specify the data format. See doc://com.apple.corefoundation/documentation/CoreFoundation/CFPropertyListFormat for possible values.
- `options`: This parameter is currently unused and should be set to 0.
- `error`: If this parameter is non-NULL, if an error occurs, on return this will contain a CFError error describing 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 A CFData object containing a serialized representation of propertyList in a the format specified by format. Ownership follows the The Create Rule.

## Discussion

Discussion

## See Also

### Exporting a Property List

- [CFPropertyListWrite(_:_:_:_:_:)](corefoundation/cfpropertylistwrite(_:_:_:_:_:).md)
- [CFPropertyListCreateXMLData(_:_:)](corefoundation/cfpropertylistcreatexmldata(_:_:).md)
- [CFPropertyListWriteToStream(_:_:_:_:)](corefoundation/cfpropertylistwritetostream(_:_:_:_:).md)
