callback from c++ to objective c
问题 I have ViewController in objective-c and most of my code is c++ (.mm). I'd like to setup some callbacks to member functions from obj-c (in c++) and call them from c++. Something like this (it's very simplifyed): @interface MyClass { } -(void)my_callback; @end @implementation MyClass -(void)my_callback { printf("called!\n"); } -(void)viewDidLoad { // setup_callback( "to my_callback ?" ); } @end and: void setup_callback(void(*func)()) { func(); } this is not correct of course. Any advice how