Object-c------语法预览

来源:互联网 发布:共享卫士 网络尖兵 编辑:程序博客网 时间:2024/05/22 00:16
  1. 基本上所有的关键字都是以@开头。
    下面举一些常见的关键字
    @interface , @implementation , @end , @public , @protected , @private , @selector , @try , @throw , @finally , @protocol , @optional , @required , @class , @property , @synthesize , @dynamic
    self , super , id , _cmd , _block , _strong , _weak

  2. 字符串以@开头
    比如 @”Hello”是OC中字符串,而“Hello”则是C语言中的字符串。

  3. 其他语法

语法 具体 基本数据类型 char、int、float、double、BOOL nil 相当于C语言中NULL,也就是0 基本语句 循环语句(do while、while、for)、条件语句(if、if-else、switch) 注释 // 和/* … */ 屏幕输出 NSLog(@”Hello”);NSlog(@”age is %i”,27);

OC程序开发过程

与C语言类似
.m -> .o -> a.out

0 0
原创粉丝点击