Skip to content

@leehambley /._src_darwin_greet.cpp secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
//
// wrapper file, calls Greeting::Greet via Objective-C
//
#if __cplusplus
extern "C" {
#endif
#include <CoreFoundation/CoreFoundation.h>
#include <iostream>
void greet() {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Greeting *g = [[Greeting alloc] init];
[g autorelease];
[g greet];
[pool release];
std::cout << "Hello Steve!" << std::endl;
}
#if __cplusplus
}
#endif
//
// Greeting.h
// Untitled
//
// Created by Lee Hambley on 9/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface Greeting : NSObject {
}
@end
//
// Untitled
//
// Created by Lee Hambley on 9/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "greeting.h"
void greet();
#include <greet.h>
#include <iostream>
int main(){
greet();
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.