1 #import "ViewController.h" 2 3 @interface ViewController () 4 5 @property(nonatomic,weak) IBOutlet UIImageView* imageView; 6 7 @end 8 ...
分类:
Web程序 时间:
2015-08-31 23:17:47
阅读次数:
222
NSlog(@"Retain count is %ld", CFGetRetainCount((__bridge CFTypeRef)self));block保环流--->>__weak typeof(AA) bb = AA__unsafe_unretained typeof(AA) bb =AA
分类:
其他好文 时间:
2015-08-31 14:49:20
阅读次数:
138
现象使用firefox访问一些网站时会遇到如下错误:
在服务器密钥交换握手信息中 SSL 收到了一个弱临时 Diffie-Hellman 密钥。 (错误码: ssl_error_weak_server_ephemeral_dh_key)解决办法在firefox上安装disable dhe插件
下载地址:https://addons.mozilla.org/en-us/firefox/addon/...
分类:
其他好文 时间:
2015-08-31 11:53:41
阅读次数:
170
Blocks是Objective-C的匿名函数。block是iOS在4.0之后新增的程序语法。
Blocks有三种类型,_NSConcreteGlobalBlock,_NSConcreteStackBlock和_NSConcreteMallocBlock。
1._NSConcreteGlobalBlock 全部的静态block,不会访问任何外部变量。
2._NSConcreteStackBl...
分类:
其他好文 时间:
2015-08-30 21:21:54
阅读次数:
169
1.我们常常使用nonatomic,很多人只知道它的效率较高,却不知道其含义,其含义是非线程安全的,也就是说多线程修改时不加锁,可能出现多个线程先后修改而成为脏数据的情况。
2.unsafe_unretained和assign的作用是一致的,如果对象数据也采用这种方式,这个property就只是指向数据的指针而已,这样说来,似乎assign和weak是一样的,但他们有个很大的区别,在下一条中说明...
分类:
移动开发 时间:
2015-08-30 21:21:26
阅读次数:
158
Your code will work fine: the weak reference will not cause a retain cycle as you explicitly instruct ARC not to increase the retainCount of your weak...
分类:
其他好文 时间:
2015-08-30 17:11:47
阅读次数:
185
Model cell#import
@interface ImageCell : UICollectionViewCell
@property (nonatomic, copy) NSString *image;
@end
#import "ImageCell.h"@interface ImageCell()
@property (weak, nonatomic) I...
分类:
移动开发 时间:
2015-08-30 10:00:18
阅读次数:
441
Model cell@interface ImageCell : UICollectionViewCell
@property (nonatomic, copy) NSString *image;
@end
@interface ImageCell()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end@implemen...
分类:
移动开发 时间:
2015-08-30 09:59:52
阅读次数:
251
#import "ViewController.h"
@interface ViewController ()
@property(nonatomic,weak)IBOutlet UIButton *button;
@property(nonatomic,weak)IBOutlet UIImageView *imageView;
@end
@implementation ViewCo...
分类:
其他好文 时间:
2015-08-30 01:01:23
阅读次数:
164
在iOS开发的过程中,我们一般不用retain,和assign,而是用strong和weak,这时候,我们可以把strong理解为retain,而weak理解为assign,比较容易理解。
在ARC情况下:
Strong
和weak:
如果一个对象同时被两个指针所引用,例如:
Object *b1 = [[Object alloc]initAge:23];
O...
分类:
其他好文 时间:
2015-08-29 18:53:14
阅读次数:
278