码迷,mamicode.com
首页 >  
搜索关键字:retain cycle    ( 2217个结果
[C++]LeetCode: 73 Linked List Cycle II
题目: 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 space? 思路: 可以参考 LeetCode: 73 Linked ...
分类:编程语言   时间:2015-01-07 13:08:14    阅读次数:161
objective-c中nonatomic,assign,copy,retain的区别
nonatomic:非原子性访问,不加同步,多线程并发访问会提高性能。如果不加此属性,则默认是两个访问方法都为原子型事务访问。(atomic是Objc使用的一种线程保护技术,基本上来讲,是防止在写未完成的时候被另外一个线程读取,造成数据错误。而这种机制是耗费系统资源的,所以在..
分类:其他好文   时间:2015-01-07 11:15:35    阅读次数:134
【leetcode】Linked List Cycle
这个题真是坑死了,只怪自己不好吧。一开始审题,以为是给定一个首尾相连的链表,查看其中是否有循环(原谅我的无知吧!!)。然后在那写啊写啊写,还在纠结是局部循环还是前一半和后一半一样这样的循环,blah blah....,此处省略各种YY。最后发现其实就是给定一个链表的头,判断这个链表是否环! 1...
分类:其他好文   时间:2015-01-07 10:43:00    阅读次数:195
objective-c中nonatomic,assign,copy,retain的区别
nonatomic:非原子性访问,不加同步,多线程并发访问会提高性能。如果不加此属性,则默认是两个访问方法都为原子型事务访问。                     (atomic是Objc使用的一种线程保护技术,基本上来讲,是防止在写未完成的时候被另外一个线程读取,造成数据错误。而这种机制是耗费系统资源的,所 以在iPhone这种小型设备上,如果没有使用多线程间的通讯编程,那么nonatom...
分类:其他好文   时间:2015-01-07 00:43:15    阅读次数:133
retain strong 和 copy 讨论,有建议的的童鞋请留言
总结下我的理解: strong weak是ARC引入的,strong相当于retain,但是对于有的类型,例如NSString,则使用strong相当于使用copy 这样直接用strong就可以直接处理retain和strong的情况了。 weak相当于assign,但是比后者多一点:对象被干掉时会将weak引用设为nil,而对nil发送消息都不会导致崩溃 否则weak引用为野指针,会出现...
分类:其他好文   时间:2015-01-06 21:42:46    阅读次数:152
[LeetCode] Linked List Cycle II 链表环起始位置
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?Hid...
分类:其他好文   时间:2015-01-06 17:42:21    阅读次数:123
EXC_BAD_ACCESS
EXC_BAD_ACCESS,就可以在控制台中看到是哪个对象被释放掉了。 另外要避免频繁的出现上述问题,下面是一些建议:1. 当引用了别人传递进来的对象时,最好retain一下,避免在别人那里已经把对象release了,记得不用是要手工release2. 如果使用了系统的通过静态方法来生成的对象,....
分类:数据库   时间:2015-01-04 22:53:35    阅读次数:252
uva 202 Repeating Decimals
Repeating DecimalsThe decimal expansion of the fraction 1/33 is, where theis used to indicate that the cycle 03 repeats indefinitely with no interveni...
分类:其他好文   时间:2015-01-04 19:10:32    阅读次数:212
leetcode 【 Linked List Cycle II 】 python 实现
公司和学校事情比较多,隔了好几天没刷题,今天继续刷起来。题目:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve i...
分类:编程语言   时间:2015-01-03 17:11:53    阅读次数:193
OC中内存管理问题之引用计数
定义一个Person类 其实引用计数这个问题大家可以理解为租房子的问题, 如果有retain alloc 代表这个人租了这间大房子, 拿到了一把钥匙, 引用计数代表房子一共有的钥匙的数量, release代表退房归还钥匙         Person * p = [[Person alloc] init];//房东盖好了一间房子, 现在是房东一个人         //a...
分类:其他好文   时间:2015-01-02 14:44:25    阅读次数:104
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!