编程语言学多了,也有件麻烦事--当突然要用另一种编程语言时,连打印都不会了。
还是多记录记录吧。
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
int i=10;
BOOL isShow=TRUE;
float f=3.14;
NSString *sName=@"wyz";
char a=97;
NSLog(@"%@",sName);
NSLog(@"%i",i);
NSLog(@"%i",isShow);
NSLog(@"%f",f);
NSLog(@"%c",a);
NSLog(@"i=%i,f=%f",i,f);
return NSApplicationMain(argc, (const char **)argv);
}
结果:
2013-10-16 22:45:14.951 testNSLog[607:303] wyz
2013-10-16 22:45:14.954 testNSLog[607:303] 10
2013-10-16 22:45:14.954 testNSLog[607:303] 1
2013-10-16 22:45:14.956 testNSLog[607:303] 3.140000
2013-10-16 22:45:14.956 testNSLog[607:303] a
2013-10-16 22:45:14.957 testNSLog[607:303] i=10,f=3.140000