---
title: "init(location:)"
framework: xctest
role: symbol
role_heading: Initializer
path: "xctest/xctsourcecodecontext/init(location:)"
---

# init(location:)

Initializes a new instance with a call stack from the executing thread and a provided source code location.

## Declaration

```swift
convenience init(location: XCTSourceCodeLocation?)
```

## Parameters

- `location`: A representation of a location in source code.

## Discussion

Discussion The system derives the call stack from NSThread.callStackReturnAddresses.

## See Also

### Initializers

- [init(callStack:location:)](xctest/xctsourcecodecontext/init(callstack:location:).md)
- [init(callStackAddresses:location:)](xctest/xctsourcecodecontext/init(callstackaddresses:location:).md)
- [init()](xctest/xctsourcecodecontext/init().md)
