I would like to be able to:
(1) initialize a C++ class from Objective-C
(2) call C++ function from Objective-C
(3) have the C++ class call a function in Objective-C (callback/delegate pattern)
(1) and (2) have already been implementing using this link. However, I'm unable to implement (3).
I'm creating an objective-C library for iOS that also wraps and takes advantage of a C++ library. I'm able to call C++ functions from the objective-C side; however, I'm trying to make a callback using delegation pattern from the C++ side to objective-C++. The idea here is to not push code from the C++ library into Objective-C++, but keep them separate so the original code is minimally changed. This is to say, I've already made the bridge from objective-C -> objective-C++ -> C++, but haven't implemented the callback from C++ -> objective-C++ where I can easily interact with objective-C.
Looking for a simple example of this. I'm trying to use delegate pattern or possibly blocking.