---
title: "AEUnflattenDesc(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1448997-aeunflattendesc
---

# AEUnflattenDesc(_:_:)

Unflattens the data in the passed buffer and creates a descriptor from it.

## Declaration

```swift
func AEUnflattenDesc(_ buffer: UnsafeRawPointer!, _ result: UnsafeMutablePointer<AEDesc>!) -> OSStatus
```

## Parameters

- `buffer`: A pointer to memory, allocated by the application, that contains flattened data produced by a previous call to doc://com.apple.documentation/documentation/coreservices/1441808-aeflattendesc.
- `result`: A null descriptor. On successful completion, points to a descriptor created from the flattened data. The caller is responsible for disposing of the descriptor.

## Return Value

Return Value A result code. Returns paramErr if the flattened data in buffer is found to be invalid. See Result Codes for other possible values.

## Discussion

Discussion This function assumes the passed buffer contains valid flattened data, produced by a previous call to AEFlattenDesc(_:_:_:_:). See that function for a description of when you might want to flatten and unflatten descriptors, and of possible limitations. Flattening and unflattening works across OS versions, including between Mac OS 9 and macOS. Flattening is endian-neutral. That is, you can save flattened data on a machine that is either big-endian or little-endian, then retrieve and unflatten the data on either type of machine, without any special steps by your application. Version-Notes Thread safe starting in OS X v10.2.

## See Also

### Serializing Apple Event Data

- [AESizeOfFlattenedDesc(_:)](coreservices/1447305-aesizeofflatteneddesc.md)
- [AEFlattenDesc(_:_:_:_:)](coreservices/1441808-aeflattendesc.md)
