Objective-c placeholder

Source: Internet
Author: User

%@ Object

%d,%i integer

%li Long Integral type

%u unsigned shaping

%f floating point/double word

%x,%x binary integer

%o Eight-binary integers

%zu size_t

%p pointer

%e floating point/double word (scientific calculation) (double)

%g floating point/double word (double)

%s C string

%.*s Pascal String

%c character

%c Unichar

%LLD 64-bit long integer

%llu unsigned 64-bit long integer

%LF 64-bit even

Percent% escape

Although there are so many placeholders, it seems that there is no placeholder for the bool type data, which is a more tangled place to look at how others have solved the problem.

BOOL studybool = YES;
NSLog (@ "Print bool type data%@", [email protected] "YES": @ "NO");//print bool type data YES
NSLog (@ "Print bool type data%d", studybool);//print bool type data 1

BOOL alsobool = NO;
NSLog (@ "Print bool type data%@", [email protected] "yes": @ "no");//print bool type data NO
NSLog (@ "Print bool type data%d", alsobool);//print bool type data 0

Detailed Description: **********************************************************
%@: Objective-c object, printed with string return Descriptionwithlocale: If so, or the description is reversed. Cftyperef the Cfcopydescription function that returns the result of the work object. (This translation has questions and suggestions to understand it in your own way).
Percent: is the '% ' character;
%d,%d,%i: 32-bit integer number (int);
%u,%u: is a 32-bit unsigned integer number (unsigned int);
%hi: A signed 16-bit integer number (short);
%hu: An unsigned 16-bit integer number (unsigned shord);
%qi: A signed 64-bit integer number (long long);
%qu: An unsigned 64-bit integer number (unsigned long long);
%x: A 32-bit unsigned integer number (unsigned int), printed using the number 0-9 hexadecimal, lowercase a-f;
%x: A 32-bit unsigned integer number (unsigned int), printed using the number 0-9 hexadecimal, uppercase a-f;
%QX: For unsigned 64-bit integers (unsigned long long), print hexadecimal with the number 0-9, lowercase a-f;
%QX: For unsigned 64-bit integers (unsigned long long), print hexadecimal with the number 0-9, uppercase a-f;
%o,%o: An unsigned 32-bit integer (unsigned int) that prints the octal number;
%f: A 64-bit floating-point number (double);
%e: A 64-bit floating-point number (double), printed using the lowercase letter E, the scientific notation describes the exponential increase and decrease;
%E: A 64-bit floating-point number (double), printing scientific symbols using an uppercase E to introduce the exponential increase and decrease;
%g: For a 64-bit floating-point number (double), the%e way to print the exponent, if the exponent is less than 4 or greater than equal precision, then the style of%f will have different embodiment;
%G: For a 64-bit floating-point number (double), the%e way to print the exponent, if the exponent is less than 4 or greater than equal precision, then the style of%f will have different embodiment;
%c: 8-bit unsigned character%c (unsigned char), by printing NSLog () as an ASCII character, or, not an ASCII character, octal format \ddd or uniform standard character encoded in hexadecimal format \udddd, Here d is a number;
%c: is a 16-bit Unicode character,%c (Unichar), that is printed by NSLog () as an ASCII character, or, not an ASCII character, an octal format \ddd or a uniform standard character encoded in hexadecimal format \\udddd, Here d is a number;
%s: for unsigned character array null-terminated, the%s system interprets its input encoding, not something else, such as utf-8;
%s: null terminates a series of 16-bit Unicode characters;
%p: null pointer (invalid *), print hexadecimal digits 0-9 and lowercase a-f, prefixed with 0x;
%l: Under the specified length, the following batch of data A,a,e,e,f,f,g,g applied to the parameters of double-precision long integer;
%A: 64-bit floating-point number (double), according to scientific notation printing using 0x and a hexadecimal digit before using the lowercase decimal point p to introduce the exponential increase and decrease;
%A: 64-bit floating-point number (double), according to scientific notation printing using 0X and a hexadecimal digit before using the upper case of the decimal point of the P-boundary sweep index decreases;
%F: A 64-bit floating-point number (double), printed in decimal notation;
%z: Modify the description below the%z length d,i,o,u,x,x for a specified type of conversion or for a certain size of the integer type parameters;
%t: Modify the parameters of the conversion for a specified type or an integer type of a certain size d,i,o,u,x,x the following%t length;
%j: Modify the parameters for the conversion of a specified type or an integer type of a certain size d,i,o,u,x,x the%j length below.

Objective-c placeholder

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.