本文列举了四种延时执行某函数的方法及其一些区别。假如延时1秒时间执行下面的方法。- (void)delayMethod { NSLog(@"execute"); }1.performSelector方法[self performSelector:@selector(delayMethod) with...
分类:
移动开发 时间:
2016-01-02 12:07:33
阅读次数:
178
一,import和include的区别; import可以防止头文件的重复包含 二,NSLog 和printf的区别: 1,NSLog可以自动换行, 输出调试信息, printf不能. 2,NSLog 函数的参数是一个NSString 对象 3,printf函...
分类:
其他好文 时间:
2016-01-02 07:04:30
阅读次数:
123
XML 解析// 1. 开始文档 - 准备工作- (void)parserDidStartDocument:(NSXMLParser *)parser { NSLog(@"1. 开始文档"); [self.videos removeAllObjects];}// 2. 开始节点- (vo...
分类:
其他好文 时间:
2015-12-30 21:36:10
阅读次数:
130
体验代码异步执行任务- (void)gcdDemo1 { // 1. 全局队列 dispatch_queue_t q = dispatch_get_global_queue(0, 0); // 2. 任务 void (^task)() = ^ { NSLog(@...
分类:
其他好文 时间:
2015-12-30 19:45:34
阅读次数:
112
NSLog各种打印 %@ 对象%d,%i 整型 (%i的老写法)%hd 短整型%ld , %lld 长整型%u 无符整型%f 浮点型和double型%0.2f 精度浮点数,只保留两位小数%x:为32位的无符号整型数(unsigned int),打印使用数字0-9的十六进制,小写a-f;%X:为32位...
分类:
移动开发 时间:
2015-12-28 13:58:18
阅读次数:
183
1. NSLog 是Foundation提供的一个输出函数,它的功能非常强大,不仅可以输出字符串,还可以输出各种对象,到后面程序还会见到大量的使用NSLog()函数。2. NS 是一个前缀,Cocoa对其所有函数、常量、类型前面都会增加“NS”前缀,该前缀用于区分该函数来自Cocoa,...
分类:
其他好文 时间:
2015-12-26 10:03:22
阅读次数:
780
int index; if (index == 0) { NSLog(@"11111"); }else if (index == 1){ NSLog(@"2222222"); }else if (index ==3){ NSLog(@"3333333"); }.........
分类:
其他好文 时间:
2015-12-25 21:03:22
阅读次数:
173
//字符串的创建 //在可变字符串中 空字符串就有意义 NSMutableString *mString = [[NSMutableString alloc]init]; NSLog(@"mString:%@",mString); ...
分类:
其他好文 时间:
2015-12-25 18:40:50
阅读次数:
106
* %d, %i 整数* %u 无符整形* %f 浮点/双字* %x, %X 二进制整数* %o 八进制整数* %zu size_t* %p 指针* %e 浮点/双字 (科学计算)* %g 浮点/双字* %s C 字符串* %.*s Pascal字符串* %c 字符* %C unichar* %ll...
分类:
其他好文 时间:
2015-12-25 11:25:20
阅读次数:
155
在做网页加载进度条的时候,发现UIWebViewDelegate中webViewDidFinishLoad方法会执行多次:- (void)webViewDidStartLoad:(UIWebView *)webView{ NSLog(@"start******");}- (void)webVi...
分类:
Web程序 时间:
2015-12-25 09:59:00
阅读次数:
1459