views:

53

answers:

2

Hello together, I want to get the height of a CGRect-rectangle. I have a simple problem in understanding why these lines return 0 height:

    CGRect lalaframe = CGRectMake(10, 30, 45, 50);
    NSLog(@"_height of test frame = %d",lalaframe.size.height);

Should be an easy fix... Thanks!

+7  A: 

You're logging with %d, that formats an integer. Try using %f (for float) instead.

cobbal
Thanks, that helps!
Cocoprogrmr
+1  A: 

agree with cobbal. I use

NSLog(@"frame :%@", NSStringFromCGRect(lalaframe))

most of the time because of its simplicity.

VdesmedT