Obj-C只是增加了一点“特殊语料”的C语言,所以可以用printf()代替NSLog()。但我们建议使用NSLog,因为它添加了特性,例如时间戳,日期戳和自动附加换行符(‘\n’)等。1.OC的数组成员是任意的对象指针 与C中的链表结构类似(以nil结尾) 一切的数组操作不能越界OC的数组分为.....
分类:
其他好文 时间:
2014-07-05 22:33:03
阅读次数:
341
NSThread:利用NSThread创建和启用一个线程1.NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(run) object:nil];,调用后调用[thread start];2.创建.....
分类:
移动开发 时间:
2014-07-03 19:12:31
阅读次数:
223
iOS Dev (67) 单例的实现
博客:http://blog.csdn.net/prevention作者:大锐哥摘自:Learn iPhone and iPad cocos2d Game Development
实现
在 .m 文件中
static MyManager *sharedManager = nil; +(MyManager*) sharedManager
{
...
分类:
移动开发 时间:
2014-07-03 18:44:09
阅读次数:
202
NSThread一.创建和启动线程1.开线程的几种方式1)先创建线程,后启动NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(run) object:nil];[thread start];2)创建...
分类:
移动开发 时间:
2014-07-03 12:58:28
阅读次数:
207
1. lua算术操作符lua支持的算数操作符:+-*/除^指数%取模-符号2. lua关系操作符大于= ==~=不等于3. 逻辑操作符and,or,not所有逻辑操作符将false,nil 视为假,其他视为真。>print(4 and 5)5max = (x>y) and x or y类似于C语言中...
分类:
其他好文 时间:
2014-07-03 11:11:36
阅读次数:
165
NSArray *stringArray = [NSArray arrayWithObjects:@"zhangsan",@"lisi",@"wangjun",@"lanlan",@"yangyi",@"qianzhongshu",@"sunwukong",@"wugang", nil]; NSA....
分类:
其他好文 时间:
2014-07-03 00:53:02
阅读次数:
238
网上看到的,记录下,备用package mainimport ( "net/http")func main() { http.Handle("/", http.FileServer(http.Dir("./"))) http.ListenAndServe(":8080", nil)...
分类:
Web程序 时间:
2014-07-01 14:07:08
阅读次数:
265
Lua提供了一组传统的,小巧的控制结构,包括用于条件执行的if,用于迭代的while、repeat和for。所有的控制结构都有一个现实的终止符号:if for while 都以end结尾,repeat以until作为结尾。控制结构中的条件表达式可以使任何的值,Lua将所有false和nil的值视为“...
分类:
其他好文 时间:
2014-07-01 12:41:38
阅读次数:
253
1、Swift,用来判断option是不是nil,相当于OC的 if(option)
if let name = option{
greeting = “if=====“
}else{
greeting = "else==="
}
2、运行switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break。
3、//使用..创建的范围...
分类:
其他好文 时间:
2014-07-01 07:05:30
阅读次数:
234
1、Swift,用来判断option是不是nil,相当于OC的 if(option)
if let name = option{
greeting = “if=====“
}else{
greeting = "else==="
}
2、运行switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break。
3、//使用..创建的范围...
分类:
其他好文 时间:
2014-06-30 20:17:41
阅读次数:
225