0

Is it possible to pass a an Objective-C pointer function to a C function?

1 Answer 1

2

not easily, as most objective-C functions are really the C function objc_messageSend with the name of the actual method passed as a selector (string).

The thing that most resembles a function pointer in objective-C is either an NSInvocation object or a selector and object pair.

Sign up to request clarification or add additional context in comments.

2 Comments

ok, and do you if it's possible to call an objective-c function from a c function?
It is, so long as the file is .m instead of .c. Objective-C is a strict superset of C and so is directly compatible with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.