I don’t know how to say, here is the example:
Objective C Code:
NSLog(@"This is a test ok, %@?", yourName);
What is the %@ called? a String place holder?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
%@is a so-called format specifier, like%dto print decimal numbers or%fto print floats. The%@is specific to Objective-C and callsdescriptionon the passed object. This method in turn returns a string that then gets printed. So this is roughly equivalent to:In the case of
NSString, the description merely returns itself. However, you can overridedescriptionfor your own objects to provide a useful descriptive string.