%d, %i signed int %u unsigned int %f float or double %e float or double in standard form or scientific notation %x hex int %X hex int %o octal int %c character %C unichar %@ object
Examples:
(1)
int num=9;
NSLog(@"The value of the integer is %i", num);
Result: The value of the integer is 9
(2)
NSDate *today= [NSDate date];
NSLog(@"the date is %@",today);
Result: the date is 2012-11-17 01:15:00 +0000
No comments:
Post a Comment