objective-c 学习
1、OC基础介绍
c 语言格式
#include <stdio.h>
int main()
{
printf("hello!");
renturn 0;
}
OC语言介绍
#import <foundation/foundation.h>
int main(int argc,const char *argv[])
{
Nslog(@"hello");
renturn (0);
}
1、多行注释用/* */
单行注释用//
2、#import <foundation/foundation.h> 导入头文件
3、int main(int argc,const char *argv[])
4、Nslog(@"hello");
NSlog:OC系统方法
NS开头表明是系统方法防止与个人,命名冲突。个人代码禁止使用Ns开头
例如:NSstring Nslog NsMutableArrary....
5.@"hello" 为参数 以@开头 为Nssting 字符串累参数
例如:%d %s %lu等