blob: 7a4f1011d39a10b5bdb428bcac44c104e6ce70be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#import <Foundation/Foundation.h>
#import <iostream>
@interface HelloWorld : NSObject {
// no instance variables
}
// methods
- (void)sayHello;
@end
@implementation HelloWorld
- (void)sayHello
{
std::cout << "Hello world" << std::endl;
}
@end
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// my stuff
HelloWorld *hw = [[HelloWorld alloc] init];
[hw autorelease];
[hw sayHello];
[pool release];
return 0;
}
|