summaryrefslogtreecommitdiff
path: root/2013-05-07
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-05-09 20:34:26 -0600
committermo khan <mo@mokhan.ca>2013-05-09 20:34:26 -0600
commit368fa097f326613c326b76cc648d78330eb7544d (patch)
tree91d0519a6189b1534c89ee13cbf1fa76cec027ce /2013-05-07
parent5dec398d8a6c7e7ad51efd6ca0f69c5f82b55adb (diff)
create a human in one file
Diffstat (limited to '2013-05-07')
-rw-r--r--2013-05-07/People/People/Human.m12
-rw-r--r--2013-05-07/People/People/main.m7
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;
}