Practice 1 Works Great

This commit is contained in:
Brent Marohnic 2013-02-07 14:54:43 -05:00
parent c9adb63f6c
commit 14cdba042f
5 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
</Bucket>

View File

@ -18,4 +18,6 @@
-(NSString*)showChild;
@property int intChild;
@end

View File

@ -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;

View File

@ -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;
}