assign对基础数据类型 (NSInteger,CGFloat)和C数据类型(int, float, double, char)等 等. 此标记说明设置器直接进?行赋值,这也是默认值。在使?用垃圾收集的应?用程序中,如 果你要?一个属性使?用assign,且这个类符合NSCopying协 议,你就...
分类:
其他好文 时间:
2014-07-09 15:45:40
阅读次数:
163
题目
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
解答
首先要注意空链表不成环;不能开额外的空间,即空间复杂度是o(1),可采用“快慢指针”查检查链表是否含有环,如果在快的指针能够追上慢的指针,则有环,否...
分类:
其他好文 时间:
2014-07-08 19:17:47
阅读次数:
160
本流程从启动应用程序后的main函数开始跟踪。
解析命令行参数并保存到ngx_cycle_t结构体中,在ngx_process_options函数中将保存配置文件路径。
调用ngx_add_inherited_sockets函数获取环境变量中关于平滑升级的一些信息。平滑升级时,旧的master进程会通过环境变量发送传递一些信息给新的master进程,新的master进程启动后要...
分类:
其他好文 时间:
2014-07-08 15:33:20
阅读次数:
191
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?判断一...
分类:
其他好文 时间:
2014-07-06 18:10:33
阅读次数:
145
先吐槽一下这个标题,空格略蛋疼,不像中文,但是不写空格看上去则更诡异,求解决方案……NSTimer会retain它的target,这样如果在控制器当中定义一个NSTimer,target指定为self,则会引起循环引用。解决方案和防止block引用self一样,第一步需要把NSTimer的操作封装到...
分类:
其他好文 时间:
2014-07-06 14:44:21
阅读次数:
141
题目如下:
Problem A: The Monocycle
A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with fiv...
分类:
其他好文 时间:
2014-07-06 11:49:47
阅读次数:
233
之前学习生活中,知道NSString的属性要用copy而不用retain,但是不知道为啥,这两天我研究了一下,然后终于明白了.
具体原因是因为用copy比用retain安全,当是NSString的时候,其实用copy和retain都行,当用NSMutableString,那么就要用copy,NSMutableString的值不会被修改,而用retain的时候,NSMutableString的值会...
分类:
其他好文 时间:
2014-07-05 23:55:06
阅读次数:
401
最近对内存管理,有了一些新的认识,以前只知道alloc,或者retain,或者copy,之后需要release或者autorelease;
只知其一,但是在工作学习中仅仅知道这些是不够用的,还需要知道属性等内部的内存存管理才行.
@property (readwrite,nonatomic,assign)NSInteger age;
@property (readwrite,no...
分类:
其他好文 时间:
2014-07-04 09:31:10
阅读次数:
354
问题描述如下:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra s...
分类:
其他好文 时间:
2014-07-03 21:00:48
阅读次数:
401
[LeetCode]Linked List Cycle...
分类:
其他好文 时间:
2014-07-03 18:42:10
阅读次数:
189