Objective-C
Objective-C is the language used to program the Cocoa toolkit. It is a thin layer on top of C with a little additional syntax, a runtime component, and a big pile of metadata to support the dynamic nature of the language. But fundamentally, Objective-C is still C. Many programmers forget Objective-C’s C heritage and fail to take advantage of C’s language features and libraries.
C callbacks in Objective-C
A question that comes up fairly frequently in online forums is, “How do I put a method into a function pointer?” Nine times out of ten, the poster actually wants to use Cocoa with an existing C API that uses callbacks. A much better question is, “I’m using a C API that uses callbacks with Cocoa, how do I make it work?”
Even though ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access