I’m a newbie in XCode programming. I have following code:
CGSize firstSize = CGSizeMake(1.0,1.0);
NSLog(@"[height] %@", firstSize.height);
//...
At runtime, I got the result:
height (null)
Could someone help me to explain while that code print null for firstSize.height?
Many thanks
Use
%finstead of%@:%@is used for all objects, here you are dealing with Core its float type, you need to use%ffor float.If you want decimal precision as well, use
%.2ffor 2 decimal digits.