---
title: MTLCommandBufferError.Code.invalidResource
framework: metal
role: symbol
role_heading: Case
path: metal/mtlcommandbuffererror-swift.struct/code/invalidresource
---

# MTLCommandBufferError.Code.invalidResource

An error code that indicates the command buffer has an invalid reference to resource.

## Declaration

```swift
case invalidResource
```

## Discussion

Discussion Typically, apps trigger this error by deleting a resource and then running a command buffer that refers to it.

## See Also

### Error codes

- [MTLCommandBufferError.Code.none](metal/mtlcommandbuffererror-swift.struct/code/none.md)
- [MTLCommandBufferError.Code.timeout](metal/mtlcommandbuffererror-swift.struct/code/timeout.md)
- [MTLCommandBufferError.Code.pageFault](metal/mtlcommandbuffererror-swift.struct/code/pagefault.md)
- [MTLCommandBufferError.Code.notPermitted](metal/mtlcommandbuffererror-swift.struct/code/notpermitted.md)
- [MTLCommandBufferError.Code.outOfMemory](metal/mtlcommandbuffererror-swift.struct/code/outofmemory.md)
- [MTLCommandBufferError.Code.memoryless](metal/mtlcommandbuffererror-swift.struct/code/memoryless.md)
- [MTLCommandBufferError.Code.deviceRemoved](metal/mtlcommandbuffererror-swift.struct/code/deviceremoved.md)
- [MTLCommandBufferError.Code.stackOverflow](metal/mtlcommandbuffererror-swift.struct/code/stackoverflow.md)
- [accessRevoked](metal/mtlcommandbuffererror-swift.struct/code/accessrevoked.md)
- [MTLCommandBufferError.Code.internal](metal/mtlcommandbuffererror-swift.struct/code/internal.md)
