-
for循环语法(通常为计数循环,while) for(布尔表达式){ } 例子for(int i;i<10;i++){ } do while循环语法(至少会执行一次) do{ }while(布尔表达式)查看全部
-
条件控制语句 跳转语句goto语法 标签声明:{ } if(布尔表达式){goto标签; }else{ goto标签; }查看全部
-
条件控制语句 分支语句if: 语法结构: if(逻辑表达式){ } if(逻辑表达式){ }else{ } 默认情况下,0为false,非0为true;查看全部
-
运算符优先级: 和数学运算中的优先级一致。可以用()改变优先级。 逻辑运算符: >,<,>=,<=,==,!= =为赋值,==为等于。查看全部
-
=表示赋值; 一元运算符:只需要一个变量的运算符; ++,-- a++,++a == a=a+1;++在前,则当前a的值为运算后的值,++在后,则当前a的值为运算前的值,--一样。 二元运算符:连接两个变量的运算符; +,-,*,/,%(求余), 三元运算符:?:,例子2>3?yes:no查看全部
-
objective-C基本数据类型: int:整数类型 float:单精度小数类型 double:双精度小数类型 char:字符类型 复合类型 NSString:@"hello world!" :OC类型字符串; "hello world!":C类型字符串; 限定词(更大的数据范围) long long long short unsigned signed 指针类型 *p 自定义类型:面向对象类型 万能类型id查看全部
-
变量声明,赋值。变量的值会被覆盖。查看全部
-
没有苹果系统,只有win10系统,如何学习IOS查看全部
-
xcode配置: 偏好设置,可以设置字体/下载模拟器/配置命令行kit查看全部
-
类的属性申明 @interface Person: NSObject @property NSString: *firstName; @property NSString: *lastName; @end @property NSNumber *yearOfBirth; @property int tearOfBirth; @property (readonly)NSString *firstName; 减号方法(普通方法又称对象方法)申明 @interface Person:NSObject -(void)someMethod; -(void)someMethodWidthValue:(SomeType)value; -(void)someMethodWidthFirstValue:(SomeType)info1 secondValue:(AnotherType)info2 @end 加好方法(类方法,又称静态方法)申明 @interface NSString:NSObject +(id)string; +(id)stringWidthString:(Nsstring *)aString; +(id)stringWidthFormat:(NSString *)format,....; +(id)stringWidthContentsOfFile:(NSString *)path encoding:(NSStringEncoding)enc erro:(NSError **)error; +(id)stringWidthCSring:(const char *)cString encoding:(NSStringEncoding)enc; @end #import "XYZPerson.h" @implementation XYZPerson @end 类的定义 @interface SimpleClass:NSObject //SimpleClass继承自NSObject @end 类的属性申明 @interface Person: NSObject @property NSString *firstName; @property NSString *lastName; @end查看全部
-
类的实现查看全部
-
加号方法查看全部
-
减号方法查看全部
-
类的属性声明2查看全部
-
类的属性声明查看全部
举报
0/150
提交
取消