码迷,mamicode.com
首页 >  
搜索关键字:retain cycle    ( 2217个结果
【学习ios之路:UI系列】绘图(drawRect)
实现代码如下: ①在自定义视图中定义3个属性//记录线条的路径 @property (nonatomic, retain) NSMutableArray *paths; //设置绘图过程中线条的颜色 @property (nonatomic, retain) UIColor *pathColor; @property (nonatomic, assign) CGFloat pathWidth; /...
分类:移动开发   时间:2015-02-05 21:54:25    阅读次数:212
[LeetCode]142.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?分析:首先使用快慢指针技巧,如果fast指针和slow指针相遇,则说明链表存在环路。当f...
分类:其他好文   时间:2015-02-05 20:29:16    阅读次数:180
内存管理
范围:任何继承了NSObject的对象,对基本数据类型无效原理:每个对象内部都保存了一个与之相关联的整数,称为引用计数器当使用alloc,new或者copy创建一个对象时,对象的引用计数器被设置为1给对象发送一条retain消息,可以使引用计数器值+1给对象发送一条release消息,可以使引用计数...
分类:其他好文   时间:2015-02-05 09:21:57    阅读次数:124
leetcode_142_Linked List Cycle II
思路: 从头开始遍历链表并将结点的引用存储在HashSet中,出现重复的地方就是出现环的地方。...
分类:其他好文   时间:2015-02-04 20:25:04    阅读次数:152
UILabel的使用
//阴影颜色@property(nonatomic,retain) UIColor *shadowColor; // default is nil (no shadow)//阴影大小@property(nonatomic) CGSize shadowOffset;
分类:其他好文   时间:2015-02-04 18:35:49    阅读次数:135
内存管理02
在oc中内存管理方法十分的严谨,OC确实强大!在Xcode中能够自动管理内存的功能,叫做ARC。但是还是要知道怎么手动管理内存。在使用对象时,系统会对该对象(object)的引用计数器进行加1操作(retain),然而只有当对象的引用计数器等于0时系统才会回收该对象,所以为了防止内存泄露必须在不.....
分类:其他好文   时间:2015-02-04 00:30:00    阅读次数:158
Linked List Cycle II
https://oj.leetcode.com/problems/linked-list-cycle-ii/Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Fo...
分类:其他好文   时间:2015-02-03 22:42:02    阅读次数:173
BZOJ 1023 仙人掌图
Description如果某个无向连通图的任意一条边至多只出现在一条简单回路(simple cycle)里,我们就称这张图为仙人图(cactus)。所谓简单回路就是指在图上不重复经过任何一个顶点的回路。举例来说,上面的第一个例子是一张仙人图,而第二个不是——注意到它有三条简单回路:(4,3,2,1,...
分类:其他好文   时间:2015-02-03 19:19:26    阅读次数:257
leetcode_141_Linked List Cycle
思路: 一想到唯一就直接联想到了hashSet,至于在不用额外存储空间的情况下把题目搞出来,这个,确实还没有想到,to be continued.........
分类:其他好文   时间:2015-02-03 13:27:23    阅读次数:174
iOS开发之全局变量
ios开发中,全局变量设置和调用方法如下: 在AppDelegate.h文件中设置全局变量: @interface ***AppDelegate{ NSString *myName; } @property (nonatomic, retain) NSString *myName; @end 在AppDelegate.m文件中实现全局变量: @synthesize myName; 假如在 Cal...
分类:移动开发   时间:2015-02-02 18:06:24    阅读次数:228
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!