---
title: record()
framework: foundation
role: symbol
role_heading: Type Method
path: foundation/nsappleeventdescriptor/record()
---

# record()

Creates and initializes a descriptor for an Apple event record whose data has yet to be set.

## Declaration

```swift
class func record() -> NSAppleEventDescriptor
```

## Return Value

Return Value An Apple event descriptor whose data has yet to be set, or nil if an error occurs.

## Discussion

Discussion An Apple event record is a descriptor whose data is a set of descriptors keyed by four-character codes. You can add information to the descriptor with methods such as setAttribute(_:forKeyword:), setDescriptor(_:forKeyword:), and setParam(_:forKeyword:). Invoking this method is equivalent to allocating an instance of NSAppleEventDescriptor and invoking init(recordDescriptor:).

## See Also

### Creating and Initializing Descriptors

- [appleEvent(withEventClass:eventID:targetDescriptor:returnID:transactionID:)](foundation/nsappleeventdescriptor/appleevent(witheventclass:eventid:targetdescriptor:returnid:transactionid:).md)
- [init(boolean:)](foundation/nsappleeventdescriptor/init(boolean:).md)
- [init(enumCode:)](foundation/nsappleeventdescriptor/init(enumcode:).md)
- [init(int32:)](foundation/nsappleeventdescriptor/init(int32:).md)
- [init(string:)](foundation/nsappleeventdescriptor/init(string:).md)
- [init(typeCode:)](foundation/nsappleeventdescriptor/init(typecode:).md)
- [list()](foundation/nsappleeventdescriptor/list().md)
- [null()](foundation/nsappleeventdescriptor/null().md)
- [init(listDescriptor:)](foundation/nsappleeventdescriptor/init(listdescriptor:).md)
- [init(recordDescriptor:)](foundation/nsappleeventdescriptor/init(recorddescriptor:).md)
- [init(aeDescNoCopy:)](foundation/nsappleeventdescriptor/init(aedescnocopy:)-5cioa.md)
- [init(descriptorType:bytes:length:)](foundation/nsappleeventdescriptor/init(descriptortype:bytes:length:).md)
- [init(descriptorType:data:)](foundation/nsappleeventdescriptor/init(descriptortype:data:).md)
- [init(eventClass:eventID:targetDescriptor:returnID:transactionID:)](foundation/nsappleeventdescriptor/init(eventclass:eventid:targetdescriptor:returnid:transactionid:).md)
