一,代码。 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //替换回车符和空格 NSString *oldStr= ...
分类:
移动开发 时间:
2017-08-25 10:57:41
阅读次数:
168
void foo(int (^blkParam)()){ NSLog(@"foo param %d",blkParam()); } void run() { //定义 返回值类型 (^block的名称)(参数类型) = ^返回值类型(参数) {...}; void (^blk)(void) = ^{... ...
分类:
其他好文 时间:
2017-08-24 10:19:32
阅读次数:
181
// Room.h #import @interface Room : NSObject @property int no;// 房间号 @end // Room.m #import "Room.h" @implementation Room - (void)dealloc { NSLog(@"%s... ...
分类:
其他好文 时间:
2017-08-23 18:17:23
阅读次数:
151
// // Person.h #import @interface Person : NSObject { int _age; } /* setter: 作用: 用于给成员变量赋值 1.一定是对象方法 2.一定没有返回值 3.方法名称以set开头, 后面跟上需要赋值的成员变量名称, 并且去掉下划线,... ...
分类:
其他好文 时间:
2017-08-22 23:21:58
阅读次数:
302
static int i = 29; @property(nonatomic,strong) NSTimer *timmer;//定时器 - (void)sendNumber{ NSLog(@"发送验证码"); self.getTelephoneCodeBtn.enabled = NO; [self... ...
分类:
其他好文 时间:
2017-08-21 23:03:18
阅读次数:
421
// main.m // 第一个OC类-方法2 #import // 1.编写类的声明 @interface Iphone : NSObject { @public float _model; int _cpu; double _size; int _color; } // 注意: OC中的方法, ... ...
分类:
其他好文 时间:
2017-08-21 18:49:42
阅读次数:
109
// // main.m // 第一个OC类-方法 #import /* C语言中函数分为声明和实现,OC中定义类, 就是在写类的声明和实现 */ // 1.编写类的声明 @interface Iphone : NSObject { @public float _model; // 型号 0 int... ...
分类:
其他好文 时间:
2017-08-21 17:48:44
阅读次数:
125
公元前 之前还是学生时代的时候给社团们学弟学妹们介绍iOS编程的时候,简单的准备了图灵ios培训第一周(使用UIWebView创建简易浏览器), NSURL *url =[NSURL URLWithString:urlString]; NSLog(urlString); NSURLRequest * ...
分类:
移动开发 时间:
2017-08-15 19:46:33
阅读次数:
293
/* Swith 格式: switch(需要匹配的值) case 匹配的值: 需要执行的语句 break; OC: char rank = 'A'; switch (rank) { case 'A': NSLog(@"优"); break; case 'B': NSLog(@"良"); break; ...
分类:
其他好文 时间:
2017-08-15 13:25:48
阅读次数:
145
/* 数组定义: OC: 有值数组 NSArray *arr0 = @[@1, @2, @3]; NSArray *arr1 = [NSArray arrayWithObjects:@1, @2, @3, nil]; NSLog(@"%@", arr1); 空数组 NSArray *arr2 = @ ...
分类:
编程语言 时间:
2017-08-15 11:59:42
阅读次数:
134