---
title: "dataFromPropertyList(_:format:errorDescription:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/propertylistserialization/datafrompropertylist(_:format:errordescription:)"
---

# dataFromPropertyList(_:format:errorDescription:)

This method is obsolete and will be deprecated soon.

## Declaration

```swift
class func dataFromPropertyList(_ plist: Any, format: PropertyListSerialization.PropertyListFormat, errorDescription errorString: UnsafeMutablePointer<NSString?>?) -> Data?
```

## Parameters

- `plist`: A property list object.
- `format`: A property list format. For possible values, see doc://com.apple.foundation/documentation/Foundation/PropertyListSerialization/PropertyListFormat.
- `errorString`: Upon return, if the conversion is successful, errorString is nil. If the conversion fails, upon return contains a string describing the nature of the error.

## Return Value

Return Value An NSData object containing plist in the format specified by format.

## Discussion

Discussion This method is obsolete and will be deprecated soon. Use data(fromPropertyList:format:options:) instead.

## See Also

### Related Documentation

- [data(fromPropertyList:format:options:)](foundation/propertylistserialization/data(frompropertylist:format:options:).md)

### Obsolete Methods

- [propertyListFromData(_:mutabilityOption:format:errorDescription:)](foundation/propertylistserialization/propertylistfromdata(_:mutabilityoption:format:errordescription:).md)
