---
title: "CreateOffsetDescriptor(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1444957-createoffsetdescriptor
---

# CreateOffsetDescriptor(_:_:)

Creates an offset descriptor that specifies the position of an element in relation to the beginning or end of its container.

## Declaration

```swift
func CreateOffsetDescriptor(_ theOffset: Int, _ theDescriptor: UnsafeMutablePointer<AEDesc>!) -> OSErr
```

## Parameters

- `theOffset`: A positive integer that specifies the offset from the beginning of the container (the first element has an offset of 1), or a negative integer that specifies the offset from the end (the last element has an offset of –1).
- `theDescriptor`: A pointer to a descriptor. On successful return, the offset descriptor created by CreateOffsetDescriptor. On error, returns a null descriptor. Your application must dispose of the descriptor after it has finished using it. See doc://com.apple.documentation/documentation/coreservices/aedesc.

## Return Value

Return Value A result code. See Result Codes.

## See Also

### Creating Object Specifiers

- [CreateCompDescriptor(_:_:_:_:_:)](coreservices/1449155-createcompdescriptor.md)
- [CreateLogicalDescriptor(_:_:_:_:)](coreservices/1445212-createlogicaldescriptor.md)
- [CreateObjSpecifier(_:_:_:_:_:_:)](coreservices/1450244-createobjspecifier.md)
- [CreateRangeDescriptor(_:_:_:_:)](coreservices/1444087-createrangedescriptor.md)
