---
title: "descriptorWithDescriptorType:bytes:length:"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsappleeventdescriptor/descriptorwithdescriptortype:bytes:length:"
---

# descriptorWithDescriptorType:bytes:length:

Creates a descriptor initialized with the specified event type that stores the specified data (from a series of bytes).

## Declaration

```occ
+ (NSAppleEventDescriptor *) descriptorWithDescriptorType:(DescType) descriptorType bytes:(const void *) bytes length:(NSUInteger) byteCount;
```

## Parameters

- `descriptorType`: The descriptor type to be set in the returned descriptor.
- `bytes`: The data, as a sequence of bytes, to be set in the returned descriptor.
- `byteCount`: The length, in bytes, of the data to be set in the returned descriptor.

## Return Value

Return Value A descriptor with the specified type and data, 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)
- [descriptorWithDescriptorType:data:](foundation/nsappleeventdescriptor/descriptorwithdescriptortype:data:.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)
- [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)
