diff --git a/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate b/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate index 89c3093..f79d33c 100644 Binary files a/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate and b/Week1/APLOC2 Week 1/APLOC2 Week 1.xcodeproj/project.xcworkspace/xcuserdata/notmyemail.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.h b/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.h index 5624c19..c5c8752 100644 --- a/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.h +++ b/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.h @@ -9,5 +9,13 @@ #import @interface Child : NSObject +{ + int intChild; + float fltChild; + BOOL blnChild; + +} + +-(NSString*)showChild; @end diff --git a/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.m b/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.m index 14c1d62..b787a44 100644 --- a/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.m +++ b/Week1/APLOC2 Week 1/APLOC2 Week 1/Child.m @@ -10,4 +10,26 @@ @implementation Child +-(id)init +{ + self = [super init]; + if (self != nil) + { + intChild = 1; + fltChild = 150.69; + blnChild = TRUE; + } + + return self; +} + + +-(NSString*)showChild +{ + NSString* returnThis = [[NSString alloc] initWithFormat:@"intChild = %d, fltChild = %f, blnChild = %c", intChild, fltChild, blnChild]; + + return returnThis; + +} + @end diff --git a/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.h b/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.h index 0edfa3e..87b94e9 100644 --- a/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.h +++ b/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.h @@ -7,7 +7,10 @@ // #import +@class Child; @interface ViewController : UIViewController - +{ + UILabel *firstLabel; +} @end diff --git a/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.m b/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.m index 1015f5c..98bb940 100644 --- a/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.m +++ b/Week1/APLOC2 Week 1/APLOC2 Week 1/ViewController.m @@ -7,6 +7,7 @@ // #import "ViewController.h" +#import "Child.h" @interface ViewController () @@ -18,6 +19,18 @@ { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. + + firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 50)]; + + Child *firstChild = [[Child alloc] init]; + if (firstChild != nil) + { + firstLabel.text = firstChild.showChild; + + } + + [self.view addSubview:firstLabel]; + } - (void)didReceiveMemoryWarning