Objective C Class Example
example.m
1//
2// main.m
3// Objective C Class example
4//
5
6#import <Foundation/Foundation.h>
7
8@interface Example : NSObject
9- (void) hello;
10@end
11
12@implementation Example
13
14- (void) hello {
15 NSLog(@"Hello world!");
16}
17
18@end
19
20int main(int argc, const char * argv[]) {
21 @autoreleasepool {
22 Example *example = [[Example alloc] init];
23 [example hello];
24 }
25 return EXIT_SUCCESS;
26}