mirror of
https://github.com/nednal12/APLOC2.git
synced 2024-06-01 10:41:30 +00:00
Final Commit
This commit is contained in:
parent
06ffe2b945
commit
8d1db02fb8
|
@ -23,6 +23,7 @@
|
||||||
65DF924016C479840035C5C9 /* ChildFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF923F16C479840035C5C9 /* ChildFactory.m */; };
|
65DF924016C479840035C5C9 /* ChildFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF923F16C479840035C5C9 /* ChildFactory.m */; };
|
||||||
65DF924316C49D240035C5C9 /* GoodChild.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF924216C49D240035C5C9 /* GoodChild.m */; };
|
65DF924316C49D240035C5C9 /* GoodChild.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF924216C49D240035C5C9 /* GoodChild.m */; };
|
||||||
65DF924916C4A89C0035C5C9 /* BadChild.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF924816C4A89C0035C5C9 /* BadChild.m */; };
|
65DF924916C4A89C0035C5C9 /* BadChild.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF924816C4A89C0035C5C9 /* BadChild.m */; };
|
||||||
|
65DF924C16C4AE670035C5C9 /* RottenChild.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DF924B16C4AE670035C5C9 /* RottenChild.m */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
@ -51,6 +52,8 @@
|
||||||
65DF924216C49D240035C5C9 /* GoodChild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoodChild.m; sourceTree = "<group>"; };
|
65DF924216C49D240035C5C9 /* GoodChild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoodChild.m; sourceTree = "<group>"; };
|
||||||
65DF924716C4A89C0035C5C9 /* BadChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BadChild.h; sourceTree = "<group>"; };
|
65DF924716C4A89C0035C5C9 /* BadChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BadChild.h; sourceTree = "<group>"; };
|
||||||
65DF924816C4A89C0035C5C9 /* BadChild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BadChild.m; sourceTree = "<group>"; };
|
65DF924816C4A89C0035C5C9 /* BadChild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BadChild.m; sourceTree = "<group>"; };
|
||||||
|
65DF924A16C4AE670035C5C9 /* RottenChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RottenChild.h; sourceTree = "<group>"; };
|
||||||
|
65DF924B16C4AE670035C5C9 /* RottenChild.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RottenChild.m; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
@ -112,6 +115,8 @@
|
||||||
65DF924216C49D240035C5C9 /* GoodChild.m */,
|
65DF924216C49D240035C5C9 /* GoodChild.m */,
|
||||||
65DF924716C4A89C0035C5C9 /* BadChild.h */,
|
65DF924716C4A89C0035C5C9 /* BadChild.h */,
|
||||||
65DF924816C4A89C0035C5C9 /* BadChild.m */,
|
65DF924816C4A89C0035C5C9 /* BadChild.m */,
|
||||||
|
65DF924A16C4AE670035C5C9 /* RottenChild.h */,
|
||||||
|
65DF924B16C4AE670035C5C9 /* RottenChild.m */,
|
||||||
);
|
);
|
||||||
path = "APLOC2 Week 1";
|
path = "APLOC2 Week 1";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -204,6 +209,7 @@
|
||||||
65DF924016C479840035C5C9 /* ChildFactory.m in Sources */,
|
65DF924016C479840035C5C9 /* ChildFactory.m in Sources */,
|
||||||
65DF924316C49D240035C5C9 /* GoodChild.m in Sources */,
|
65DF924316C49D240035C5C9 /* GoodChild.m in Sources */,
|
||||||
65DF924916C4A89C0035C5C9 /* BadChild.m in Sources */,
|
65DF924916C4A89C0035C5C9 /* BadChild.m in Sources */,
|
||||||
|
65DF924C16C4AE670035C5C9 /* RottenChild.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
|
@ -19,7 +19,7 @@ typedef enum
|
||||||
|
|
||||||
@interface Child : NSObject
|
@interface Child : NSObject
|
||||||
{
|
{
|
||||||
@protected
|
@public
|
||||||
NSString *strName;
|
NSString *strName;
|
||||||
int intChild;
|
int intChild;
|
||||||
EChildType childType;
|
EChildType childType;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
-(void)showName
|
-(void)showName
|
||||||
{
|
{
|
||||||
NSLog(@"My name is %@", strName);
|
NSLog(@"My name is %@", strName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@
|
||||||
|
|
||||||
-(NSString*)showChild
|
-(NSString*)showChild
|
||||||
{
|
{
|
||||||
NSString* returnThis = [[NSString alloc] initWithFormat:@"intChild = %d", intChild];
|
NSString* returnThis = [[NSString alloc] initWithFormat:@"My name is = %@", strName];
|
||||||
|
|
||||||
|
|
||||||
/* NSString* returnThis = [[NSString alloc] initWithFormat:@"blnChild = %c", blnChild];
|
/* NSString* returnThis = [[NSString alloc] initWithFormat:@"blnChild = %c", blnChild];
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
{
|
{
|
||||||
return [[Child alloc] initWithDetails:1 inpStrName:@"Connor"];
|
return [[Child alloc] initWithDetails:1 inpStrName:@"Connor"];
|
||||||
}
|
}
|
||||||
|
else if (childType == 3)
|
||||||
|
{
|
||||||
|
return [[Child alloc] initWithDetails:3 inpStrName:@"Brent"];
|
||||||
|
}
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
{
|
{
|
||||||
intChild = 0;
|
intChild = 0;
|
||||||
strName = @"Jack";
|
strName = @"Jack";
|
||||||
|
childType = CHILDTYPE_GOOD;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
16
Week1/APLOC2 Week 1/APLOC2 Week 1/RottenChild.h
Normal file
16
Week1/APLOC2 Week 1/APLOC2 Week 1/RottenChild.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// RottenChild.h
|
||||||
|
// APLOC2 Week 1
|
||||||
|
//
|
||||||
|
// Created by Brent Marohnic on 2/7/13.
|
||||||
|
// Copyright (c) 2013 Brent Marohnic. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "Child.h"
|
||||||
|
|
||||||
|
@interface RottenChild : Child
|
||||||
|
|
||||||
|
-(void)setAttributes;
|
||||||
|
|
||||||
|
@end
|
19
Week1/APLOC2 Week 1/APLOC2 Week 1/RottenChild.m
Normal file
19
Week1/APLOC2 Week 1/APLOC2 Week 1/RottenChild.m
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// RottenChild.m
|
||||||
|
// APLOC2 Week 1
|
||||||
|
//
|
||||||
|
// Created by Brent Marohnic on 2/7/13.
|
||||||
|
// Copyright (c) 2013 Brent Marohnic. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "RottenChild.h"
|
||||||
|
#import "Child.h"
|
||||||
|
|
||||||
|
@implementation RottenChild
|
||||||
|
|
||||||
|
-(void)setAttributes
|
||||||
|
{
|
||||||
|
intChild = 3;
|
||||||
|
strName = @"Brent";
|
||||||
|
}
|
||||||
|
@end
|
|
@ -10,6 +10,8 @@
|
||||||
#import "Child.h"
|
#import "Child.h"
|
||||||
#import "ChildFactory.h"
|
#import "ChildFactory.h"
|
||||||
#import "GoodChild.h"
|
#import "GoodChild.h"
|
||||||
|
#import "BadChild.h"
|
||||||
|
#import "RottenChild.h"
|
||||||
|
|
||||||
@interface ViewController ()
|
@interface ViewController ()
|
||||||
|
|
||||||
|
@ -28,6 +30,8 @@
|
||||||
[Jack showName];
|
[Jack showName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Instantiate instances of the subclasses and set their attributes
|
||||||
GoodChild *goodChild = [[GoodChild alloc] init];
|
GoodChild *goodChild = [[GoodChild alloc] init];
|
||||||
{
|
{
|
||||||
if (goodChild != nil)
|
if (goodChild != nil)
|
||||||
|
@ -36,9 +40,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BadChild *badChild = [[BadChild alloc] init];
|
||||||
|
{
|
||||||
|
if (badChild != nil)
|
||||||
|
{
|
||||||
|
[badChild setAttributes];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RottenChild *rottenChild = [[RottenChild alloc] init];
|
||||||
|
{
|
||||||
|
if (rottenChild != nil)
|
||||||
|
{
|
||||||
|
[rottenChild setAttributes];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
// Do any additional setup after loading the view, typically from a nib.
|
// Do any additional setup after loading the view, typically from a nib.
|
||||||
|
|
||||||
|
//Setup the labels that will hold the static and dynamic values
|
||||||
|
|
||||||
firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
|
firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
|
||||||
secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 51, 320, 50)];
|
secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 51, 320, 50)];
|
||||||
|
|
||||||
|
@ -58,8 +83,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
firstLabel.text = @"Good Child";
|
firstLabel.text = @"Good Child";
|
||||||
|
secondLabel.text = goodChild->strName;
|
||||||
thirdLabel.text = @"Bad Child";
|
thirdLabel.text = @"Bad Child";
|
||||||
|
fourthLabel.text = badChild->strName;
|
||||||
fifthLabel.text = @"Rotten Child";
|
fifthLabel.text = @"Rotten Child";
|
||||||
|
sixthLabel.text = rottenChild->strName;
|
||||||
|
|
||||||
|
|
||||||
|
//Show the labels
|
||||||
|
|
||||||
[self.view addSubview:firstLabel];
|
[self.view addSubview:firstLabel];
|
||||||
[self.view addSubview:secondLabel];
|
[self.view addSubview:secondLabel];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user