Created
August 9, 2016 15:54
-
-
Save kiliankoe/2b32792f25ca9fea7e08a46195afbcbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface Person : NSObject | |
{ | |
@private char *name; | |
} | |
@property (readwrite, assign) char *name; | |
- (void)sayHello; | |
@end | |
@implementation Person | |
@synthesize name; | |
- (void)sayHello | |
{ | |
printf("Hello, my name is %s!\n", [self name]); | |
} | |
@end | |
int main() | |
{ | |
Person *kilian = [Person new]; | |
kilian.name = "Kilian"; | |
[kilian sayHello]; | |
Person *sexy = [Person new]; | |
sexy.name = "Hendrik"; | |
[sexy sayHello]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment