diff options
| author | mo khan <mo@mokhan.ca> | 2013-05-09 20:34:26 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-05-09 20:34:26 -0600 |
| commit | 368fa097f326613c326b76cc648d78330eb7544d (patch) | |
| tree | 91d0519a6189b1534c89ee13cbf1fa76cec027ce | |
| parent | 5dec398d8a6c7e7ad51efd6ca0f69c5f82b55adb (diff) | |
create a human in one file
| -rw-r--r-- | 2013-05-07/People/People/Human.m | 12 | ||||
| -rw-r--r-- | 2013-05-07/People/People/main.m | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/2013-05-07/People/People/Human.m b/2013-05-07/People/People/Human.m new file mode 100644 index 0000000..214c3e3 --- /dev/null +++ b/2013-05-07/People/People/Human.m @@ -0,0 +1,12 @@ + +@interface Human : NSObject +@property (strong, nonatomic) NSString* name; +-(NSString *)sayHello; +@end + +@implementation Human +-(NSString *)sayHello +{ + return @"HELLO"; +} +@end diff --git a/2013-05-07/People/People/main.m b/2013-05-07/People/People/main.m index 165c572..60a0de5 100644 --- a/2013-05-07/People/People/main.m +++ b/2013-05-07/People/People/main.m @@ -8,6 +8,7 @@ #import <Foundation/Foundation.h> #import "Person.h" +#import "Human.m" int main(int argc, const char * argv[]) { @@ -24,6 +25,12 @@ int main(int argc, const char * argv[]) NSLog(@"%@", [person tellMeSomethingIDontKnow]); [person change:@"Mo" last_name:@"Ka" age:29]; NSLog(@"%@", [person tellMeSomethingIDontKnow]); + + + Human * human = [Human new]; + [human setName:@"mo"]; + NSLog(@"%@", [human name]); + NSLog(@"%@", [human sayHello]); } return 0; } |
