Home » IOS » IOS NSLog output format

IOS NSLog output format



%d,%i integer to decimal form output with the symbol (certificate output symbol)

%o in octal output form signed integer (not 0 output prefix)

%x to sixteen hexadecimal output form unsigned integer (not output prefix 0x)

%u to unsigned integer decimal form output

%c in character form output, output only one character


%s C string output style
%f in decimal form output float, the default output 6 decimal

%e in exponential form output float, the digital part of the default output 6 decimal

%g automatically use%f or one of%e, ensure the output width shorter format, and no nonsense 0
output
%p in the form of sixteen hexadecimal output pointer variable represents the value of
.
%@ output Objective-C



In% with the format character, you can also insert the following additional symbols:



L (letter) before in o format characters D, x, u, and output for long integer integer; also available in F, e, G, is used to output long floating-point number

M (a positive integer) specifies the minimum width for output data

.n for floating-point decimal output, said N; for string, said the number of characters of
interception
- said output values to the left alignment


Latest