//读取模板template/index.html的内容 b, err := ioutil.ReadFile("template/index.html") if err != nil { log.Println(err) } s := string(b) t, _ := template.New("").Funcs(template.FuncMap{"ShowS":strin...
分类:
其他好文 时间:
2014-09-10 11:00:50
阅读次数:
253
例如,要延后执行某项任务,可以有下面两种实现方式,而我们应该优先考虑第二种:// Using performSelect: withObject: afterDelay:[self performSelector: @selector(dosomething) withObject:nil ...
分类:
其他好文 时间:
2014-09-09 22:46:39
阅读次数:
184
member函数用法很奇怪,用一个元素到list中查找,如果找到,则将找到的元素和之后所有元素变成一个新的list返回,如果找不到则返回nil.(set 'aList '(a b c d e f g h)) → (a b c d e f g h)
(member 'd aList) → (d e f g h)
(member 55 aList) ...
分类:
其他好文 时间:
2014-09-07 23:52:26
阅读次数:
339
在Foundation框架中提供一种字典集合,它是由“键-值”对构成的集合。键集合不能重复,值集合没有特殊要求。键和值集合中的元素可以是任何对象,但是不能是nil。Foundation框架字典类也分为NSDictionary不可变字典...
分类:
编程语言 时间:
2014-09-07 22:36:06
阅读次数:
345
在Foundation框架中提供一种字典集合,它是由“键-值”对构成的集合。键集合不能重复,值集合没有特殊要求。键和值集合中的元素可以是任何对象,但是不能是nil。Foundation框架字典类也分为NSDictionary不可变字典和NSMutableDictionary可变字典。一、NSDictionary类NSDictionary有很多方法和属性,下面总结其常用的方法和属性。initWith...
分类:
编程语言 时间:
2014-09-07 22:30:25
阅读次数:
311
在Foundation框架中提供一种字典集合,它是由“键-值”对构成的集合。键集合不能重复,值集合没有特殊要求。键和值集合中的元素可以是任何对象,但是不能是nil。Foundation框架字典类也分为NSDictionary不可变字典和NSMutableDictionary可变字典。一、NSDict...
分类:
编程语言 时间:
2014-09-07 22:27:05
阅读次数:
241
头文件包含AVFoundation.framework1、初始化Capture // Grab the back-facing camera AVCaptureDevice *backFacingCamera = nil; NSArray *devices = [AVCaptureDevice de...
分类:
其他好文 时间:
2014-09-05 17:51:01
阅读次数:
172
1、lua中的标识符可以是由任意字母、数字和下划线构成的字符串,但不能以数字开头。2、lua将通常类似"_VALUE"的标识符作为保留标识符3、lua的保留字 and break do else elseif end false for function if in loacl nil not or...
分类:
其他好文 时间:
2014-09-05 11:20:51
阅读次数:
194
In Ruby, you check withnil?if an object is nil:article = nilarticle.nil? # => trueempty?checks if an element - like a string or an array f.e. - is em....
分类:
其他好文 时间:
2014-09-04 09:39:17
阅读次数:
214
第一种方式
NSString *phone = @“88888888”
if (phone != nil) {
NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",phone];
NSURL *...
分类:
移动开发 时间:
2014-09-04 00:15:37
阅读次数:
264