@property 参数copy:NSString;strong:一般对象weak:UI控件assign:基本数据类型instancetypeinstancetype在类型表示上,跟id一样,可以表示任何对象类型instancetype只能用在返回值类型上,不能像id一样用在参数类型上instanc...
分类:
其他好文 时间:
2015-04-03 00:05:40
阅读次数:
161
#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UIImageView *tomImageView;@end@implementation ViewControlle...
分类:
移动开发 时间:
2015-04-02 20:38:42
阅读次数:
137
在Objective-C的ARC模式中, id obj1 = [[NSObject alloc] init]; 这里虽然没有显示的声明为__strong,但是Objective-C默认声明的一个对象就为__strong,即: id obj1 = [[NSObject alloc] init]; 和 id __stron...
分类:
移动开发 时间:
2015-03-31 20:37:20
阅读次数:
128
1.先上代码 id __weak obj=[[NSObject alloc]init]; NSLog(@"弱引用自身地址:%p",&obj); NSLog(@"弱引用指向地址:%p",obj); id __strong obj0=[[NSObject alloc]init]; ...
分类:
其他好文 时间:
2015-03-30 17:54:07
阅读次数:
114
copy:建立一个索引计数为1的对象,然后释放旧对象 对NSString对NSString 它指出,在赋值时使用传入值的一份拷贝。拷贝工作由copy方法执行,此属性只对那些实行了NSCopying协议的对象类型有效。更深入的讨论,请参考“复制”部分。retain:释放旧的对象,将旧对象的值赋予输入对...
分类:
其他好文 时间:
2015-03-30 16:13:43
阅读次数:
148
ASIHTTPRequest 在relase模式下失效表现为,调用网络请求后没有任何反应原因之一: ARC模式下,在ASIHTTPRequest 前面会加上__weak来解决循环应用,这个__weak引起的问题解决 : ASIFormDataRequest *asiRequest = [ASIFor...
分类:
Web程序 时间:
2015-03-30 16:12:21
阅读次数:
153
http://stackoverflow.com/questions/9262535/explanation-of-strong-and-weak-storage-in-ios5The difference is that an object will be deallocated as soon ...
分类:
移动开发 时间:
2015-03-30 10:51:50
阅读次数:
143
#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UILabel *remindLabel;@end@implementation ViewController- (v...
分类:
编程语言 时间:
2015-03-29 17:56:08
阅读次数:
142
C++智能指针主要是在普通指针的基础上封装了一层,使得使用者对指针的使用更加方便和放心,在使用的过程中不用担心指针因为释放问题而导致的异常。在C++11中,智能指针主要有三种:shared_ptr ptr, unique_ptr ptr, weak_ptr ptr;
shared_ptr ptr的初始化可以通过以下几种方式:
1)shared_ptr ptr = m...
分类:
编程语言 时间:
2015-03-29 01:54:51
阅读次数:
215
@property 参数copy:NSString;strong:一般对象weak:UI控件assign:基本数据类型instancetypeinstancetype在类型表示上,跟id一样,可以表示任何对象类型instancetype只能用在返回值类型上,不能像id一样用在参数类型上instanc...
分类:
移动开发 时间:
2015-03-28 18:31:09
阅读次数:
137