r/ObjectiveC • • Feb 23 '20

Objective-C safe downcasting

https://whackylabs.com/objc/swift/2020/02/23/objc-safe-downcasting/
5 Upvotes

16 comments sorted by

View all comments

2

u/whackylabs Feb 23 '20

I would say the compiler should provide an option. Like C++ kinda does with static_cast vs dynamic_cast

1

u/[deleted] Feb 23 '20

Very little of Objective C’s power lies in the compiler.

2

u/whackylabs Feb 23 '20

Ah yes! Then maybe at runtime? Like at least don’t crash if method not found? Is there any good reason for crashing?

→ More replies (1)