I am trying to see some properties of a CGRect and doing:
NSLog(@"%@", frame);
However, I get an error that says CGRect
is not an id
type. How would I print the frame to see attributes of it?
You need to use NSStringFromCGRect
which will convert the CG structs
into NSString
, Refer below:-
NSLog(@"%@", NSStringFromCGRect(frame));
Also below are the following other functions which can be used for NSLog
CG Structs
as well:-
NSStringFromCGPoint NSStringFromCGSize NSStringFromCGRect NSStringFromCGAffineTransform NSStringFromUIEdgeInsets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With