garettbass/oc
View on GitHub ↗ ★ 63 C
Macro magic for declaring/calling Objective-C APIs from C11 or C++. Preloads selectors, chooses the correct objc_msgSend to call per method/platform.
3 mentions on Hacker News by 1 person: 0 stories, 3 comments · first 2021-12-12 · latest 2025-04-18
20082026
-
Yes, technically it's possible by wrapping the ObjC runtime API, see solutions like these: - https://github.com/garettbass/oc - https://github.com/mitchellh/zig-objc Whether that's better than writing ObjC directly is another question,…
comment by flohofwoe · 2025-04-18 · in Is it possible to write plain C iOS app in 2025? -
Here's something similar by Garrett Bass: https://github.com/garettbass/oc ...I also experimented a bit with parsing macOS system headers via clang-ast-dump and then code-generating C and Zig bindings but that didn't get far:…
comment by flohofwoe · 2024-04-19 · in C-Macs – a pure C macOS application -
…by going directly through the Objective-C runtime API, but this requires either macro magic (like: https://github.com/garettbass/oc/ ), or code-generated headers (which was most likely used in the official Metal-cpp wrapper:…
comment by flohofwoe · 2021-12-12 · in Space-shooter.c: cross-platform, top-down 2D space shooter written in C