<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTSourceCodeContext/init(callStack:location:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTSourceCodeContext(im)initWithCallStack:location:"
  },
  "title" : "init(callStack:location:)"
}
-->

# init(callStack:location:)

Initializes a new instance with a provided call stack and source code location.

```
init(callStack: [XCTSourceCodeFrame], location: XCTSourceCodeLocation?)
```

## Parameters

`callStack`

An array of source code frames that describe the call stack.

`location`

A representation of a location in source code.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)