---
title: "init(typeCode:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsappleeventdescriptor/init(typecode:)"
---

# init(typeCode:)

Creates a descriptor initialized with type typeType that stores the specified type value.

## Declaration

```swift
init(typeCode: OSType)
```

## Parameters

- `typeCode`: The type value to be set in the returned descriptor.

## Return Value

Return Value A descriptor with the specified type, or nil if an error occurs.

## 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)
- [list()](foundation/nsappleeventdescriptor/list().md)
- [null()](foundation/nsappleeventdescriptor/null().md)
- [record()](foundation/nsappleeventdescriptor/record().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)
