_strong Person *p强指针_weak Person *p弱指针Person *p强指针 ,默认是强指针单对象ARC中只要没有被强指针指向的对象,内存就会被释放_weak Person *p=[[Person alloc]init];在创建完就会被释放多对象人拥有狗@property (...
分类:
其他好文 时间:
2016-01-20 22:18:48
阅读次数:
130
1.assignassign只是简单赋值,不更改索引计数,适用于基础数据类型 (例如NSInteger,CGFloat)和C数据类型(int, float, double, char, 等) 2.copycopy用来建立一个索引计数为1的对象,然后释放旧对象,常用语NSString ,指在赋值时.....
分类:
其他好文 时间:
2016-01-20 01:02:04
阅读次数:
208
一、weak和strong 1.理解 刚开始学UI的时候,对于weak和strong的描述看得最多的就是“由ARC引入,weak相当于OC中的assign,但是weak用于修饰对象,但是他们都不会造成引用计数加1;而strong则相当于OC中规定retain,它会造成引用计数加1”。 ARC的...
分类:
移动开发 时间:
2016-01-19 23:38:40
阅读次数:
2703
使用assign: 对基础数据类型 (NSInteger)和C数据类型(int, float, double, char,等)使用copy: 对NSString使用retain: 对其他NSObject和其子类assign就是简单的赋值,不更改引用计数,所以直接使用基础数据copy是直接拷贝内容,成...
分类:
移动开发 时间:
2016-01-19 17:12:31
阅读次数:
198
首先我们要布局一下,使用sizeclass来布局:连线过来:
@property (weak, nonatomic) IBOutlet UIButton *bird;
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *ices;对于冰块的连线,因为我们这里的冰块有4块,所以我们直接连的是一个数组
懒加载一个U...
分类:
其他好文 时间:
2016-01-19 10:40:53
阅读次数:
153
#import "ViewController.h"#import @interface ViewController ()@property (weak, nonatomic) IBOutlet UIImageView *imageView;@end@implementation ViewCont...
分类:
其他好文 时间:
2016-01-18 22:49:03
阅读次数:
230
#import "ViewController.h"#import @interface ViewController () @property (nonatomic, weak) AVCaptureSession *session;@property (nonatomic, weak) AVCap...
分类:
其他好文 时间:
2016-01-18 22:45:42
阅读次数:
228
#import "ViewController.h"#import @interface ViewController ()/** 地理编码 */@property (nonatomic, strong) CLGeocoder *geoC;@property (weak, nonatomic) IB...
分类:
其他好文 时间:
2016-01-17 20:06:26
阅读次数:
107
小文件下载NSURLConnection-delegate实现,可以监听到下载的进度,但是还是无法解决内存飙升的问题,所以仅限小文件下载 1 @interface ViewController () 2 @property (weak, nonatomic) IBOutlet UIProgressV...
分类:
移动开发 时间:
2016-01-17 12:07:09
阅读次数:
249
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Automatic_Reference_Counting_in_Delphi_Mobile_Compilers#Weak_ReferencesWeak ReferencesAnother impo...
分类:
其他好文 时间:
2016-01-16 19:07:38
阅读次数:
121