or
The format of NSLog is as follows:
% @ objects
%d, %i integer
%hi short integer
%lli long integer
%u unsigned shaping
%f floating point/doubleword
A %0.2f floating-point number with only two decimal places.
%x, %X binary integer
%o octal integer
%zu size_t
%p pointer
%e floating point/double word (scientific calculation)
%g floating-point/double-word technology method (using the shortest method)
%s C (character) string
%. Pascal string
%c character
%C unichar
%lld 64-bit long integer (long long)
%llu unsigned 64-bit long integer
%Lf 64-bit doubleword
%lu sizeof(i) Number of bytes in memory
There are some similar objects, such as CGRect, CGSize and so on.
Print CGRect:
NSLog(@“% @”,NSStringFromCGRect(some cgrect));
Print CGSize:
NSLog(@“% @”,NSStringFromCGSize(some CG Size));
The others are: