What would I recommend, and I had to do this for the project I was working on, you can have several obj-C ++ files that provide both C / C ++ api and the obj-c internal code to run the document blinks.
Essentially, you are creating a standard C / C ++ header file. On the code side, you create a .m file or .mm file.
This would allow you to write obj-c a single insert of questions directly into the C / C ++ function, and since the header file is in simple C / C ++, this will not be a compiler error for .mm files. in project.
This, of course, involves compiling with a compiler (like GCC) that speaks both languages.
A simple and (verified) example of such an approach would be:
TriggerBounce.h
void TriggerBounce(char * filepath);
TriggerBounce.m
#import <Cocoa/Cocoa.h> void TriggerBounce(char * filepath) { NSString *pathToFile = [NSString stringWithCString:filepath encoding:NSUTF8StringEncoding]; [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.apple.DownloadFileFinished" object:pathToFile]; }
source share