Objective-C: Display frame size with NSLog

Width and height values are CGFloat values. To display them, you need to use the %f formatter from NSLog. But displaying these variables can be quite verbose, see below:

NSLog("frame: %fx%f", myview.frame.size.width, myview.frame.size.height);

Output will show :

frame: 320.000000x480.000000

There are two other way to display frame size with NSStringFromCGRect() or [NSValue valueWithCGRect:] :

NSLog("frame: %@", NSStringFromCGRect(myview.frame);
NSLog("frame: %@", [NSValue valueWithCGRect:myview.frame]);

Output :

frame: {{0, 0}, {320, 480}}
frame: NSRect: {{0, 0}, {320, 480}}