weak/拷贝1. weak只要没有strong指针指向对象,该对象就会被销毁2. 拷贝NSString和block用copycopy语法的作用产生一个副本修改了副本(源对象)并不会影响源对象(副本)实现拷贝的方法copy: 返回的是不可变副本可变字符串调用copy生成不可变的副本副本与源对象(不可...
分类:
其他好文 时间:
2015-08-25 23:11:19
阅读次数:
144
<?xml version="1.0" encoding="UTF-8" ?> <!-- All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. --> <!-- ? tc-config-reference.xml ? This is a sample Terraco...
分类:
其他好文 时间:
2015-08-25 19:46:33
阅读次数:
211
http://codeforces.com/problemset/problem/61/E
E. Enemy is weak
time limit per test
5 seconds
memory limit per test
256 megabytes
input
standard input
output
stan...
分类:
编程语言 时间:
2015-08-25 19:45:05
阅读次数:
600
1. 虽然一般情况下传参使用const-by-reference-to-const比较好,但返回值有时必须是对象而不是引用: 当reference绑定到函数内创建的局部对象时,函数调用结束后引用绑定在一个不存在的对象; 当reference绑定到堆内存对象时,函数调用后比较容易忽略内存释放,特别.....
分类:
编程语言 时间:
2015-08-25 19:22:59
阅读次数:
134
1. 以reference-to-const传递参数的优点: 避免局部对象的构造和析构,节省时间和空间; 避免参数派生类对象向基类对象传递时的"对象切割",实现面向对象;2. reference虽然是"别名",但是底层实现往往是指针,因此对于内置类型,选用pass-by-value效率更高.这也.....
分类:
编程语言 时间:
2015-08-25 19:11:08
阅读次数:
136
Item 10:Have assignment operators return a reference to *this.
这是关于赋值运算符的编程惯例,用来支持链式的赋值语句:
int x, y, z;
...
x = y = z = 1;
在C++中,它相当于:
x = ( y = ( z = 1 ) );
这是因为=运算符是右结合的,链式赋值时...
分类:
编程语言 时间:
2015-08-25 16:34:23
阅读次数:
146
我makefile出现这个错误:HelloWorldServer.c:(.text+0xaa): undefined reference to `zmq_send'collect2: error: ld returned 1 exit statusmake: *** [HelloWorldServe...
分类:
其他好文 时间:
2015-08-25 15:59:58
阅读次数:
13927
模型(model)首先需要一个文件上传的模型:FileUpload.php true, 'types' => 'jpg, jpeg, gif, png'), ); } }注意:> 关于更多验证规则的说明请查看 Reference: Model rules valida...
分类:
Web程序 时间:
2015-08-25 15:53:27
阅读次数:
190
Introduction As you may know event handlers are a common source of memory leaks caused by the persistence of objects that are not used anymore, and yo...
1.readonly是只读2.readwrite是读写3.@property关键字:设置成员变量的属性(有读/写,赋值assign,retain,copy ,以及对多线程的支持nonatomic)。4.nonatomic非原子性访问,对属性赋值的时候不加锁,多线程并发访问会提高性能。如果不加此属性,...
分类:
其他好文 时间:
2015-08-21 15:20:35
阅读次数:
288