I had to implement a C function in an Objective-C class that normally would get called with int main
(in it\'s own file). Since I\'m unfamiliar with splicing code I
It's called just the same as you would from C and you can call any C function you like:
// Cocoa Imports
#import "AppDelegate.h"
...
// C Inlcudes
#include <stdio.h>
// (int main had to change to something else obviously)
int dos (const char *filename)
{
printf ("I was passed '%s'\n", filename);
}
// (back to cocoa)
@implementation AppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
dos("/path/to/some/file");
}