mirror of
https://github.com/nednal12/APLOC2.git
synced 2024-06-14 05:29:28 +00:00
Practice 1 Works Great
This commit is contained in:
parent
c9adb63f6c
commit
14cdba042f
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "1.0">
|
||||
</Bucket>
|
|
@ -18,4 +18,6 @@
|
|||
|
||||
-(NSString*)showChild;
|
||||
|
||||
@property int intChild;
|
||||
|
||||
@end
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#import "Child.h"
|
||||
|
||||
@implementation Child
|
||||
@synthesize intChild;
|
||||
|
||||
-(id)init
|
||||
{
|
||||
|
@ -26,7 +27,11 @@
|
|||
|
||||
-(NSString*)showChild
|
||||
{
|
||||
NSString* returnThis = [[NSString alloc] initWithFormat:@"intChild = %d, fltChild = %f, blnChild = %c", intChild, fltChild, blnChild];
|
||||
NSString* returnThis = [[NSString alloc] initWithFormat:@"intChild = %d, fltChild = %1.2f, blnChild = %c", intChild, fltChild, blnChild];
|
||||
|
||||
|
||||
/* NSString* returnThis = [[NSString alloc] initWithFormat:@"blnChild = %c", blnChild];
|
||||
*/
|
||||
|
||||
return returnThis;
|
||||
|
||||
|
|
|
@ -20,11 +20,14 @@
|
|||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
|
||||
firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 200)];
|
||||
firstLabel.numberOfLines = 2;
|
||||
|
||||
Child *firstChild = [[Child alloc] init];
|
||||
if (firstChild != nil)
|
||||
{
|
||||
firstChild.intChild = 2;
|
||||
|
||||
firstLabel.text = firstChild.showChild;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user