# \#nsobject

**URL:** https://forums.swift.org/tag/nsobject/1082.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Lazy NSObject + deinit = trap](https://forums.swift.org/t/lazy-nsobject-deinit-trap/89879)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 4\
**Last updated:** [November 17, 2026, 5:59pm UTC](https://forums.swift.org/t/lazy-nsobject-deinit-trap/89879 "2026-11-17T17:59:20Z")

</div>

Found an interesting foot-gun (only traps with NSObject classes and only with Foundation on Apple platforms): import Foundation class C: NSObject { lazy var foo: Int = { // Thread 1: abort with payload or r…

---

## [Chaining optionals produces inexplicable compiler "bug"](https://forums.swift.org/t/chaining-optionals-produces-inexplicable-compiler-bug/85763)

<div class="topic-metadata">

**Author:** [@FxFactory](https://forums.swift.org/u/FxFactory)\
**Replies:** 4\
**Last updated:** [April 2, 2026, 12:05am UTC](https://forums.swift.org/t/chaining-optionals-produces-inexplicable-compiler-bug/85763 "2026-04-02T00:05:52Z")

</div>

I’m at someone’s mercy to explain why the following would not just fail to compile, but put the compiler in a state where it’s incapable of showing a diagnostic message: import Cocoa @objc public class Media : NSObject…

---

## [Cannot send URLProtocol subclass across actor boundary](https://forums.swift.org/t/cannot-send-urlprotocol-subclass-across-actor-boundary/82277)

<div class="topic-metadata">

**Author:** [@andreabou](https://forums.swift.org/u/andreabou)\
**Replies:** 1\
**Last updated:** [September 22, 2025, 4:39pm UTC](https://forums.swift.org/t/cannot-send-urlprotocol-subclass-across-actor-boundary/82277 "2025-09-22T16:39:13Z")

</div>

Hello fellow nerds, I came across this very annoying compilation error after upgrading to Xcode 26.0 and Swift 6.2. Say you have this actor: import Foundation @globalActor actor MyActor: GlobalActor { static let …

---

## [Creating a proxy of an object and casting it as the object's type](https://forums.swift.org/t/creating-a-proxy-of-an-object-and-casting-it-as-the-objects-type/77453)

<div class="topic-metadata">

**Author:** [@flocked](https://forums.swift.org/u/flocked)\
**Replies:** 3\
**Last updated:** [January 26, 2025, 3:35am UTC](https://forums.swift.org/t/creating-a-proxy-of-an-object-and-casting-it-as-the-objects-type/77453 "2025-01-26T03:35:52Z")

</div>

Is it possible to create a proxy of a NSObject and casting it as the object's type. Specifically I want to create a similar behaviour as NSView's func animator() -\> Self which returns the view as proxy. The view returne…
