转:http://stackoverflow.com/questions/9262535/explanation-of-strong-and-weak-storage-in-ios5觉得讲的很容易理解 The difference is that an object will be dealloca...
分类:
移动开发 时间:
2015-06-26 10:40:47
阅读次数:
129
自动布局#import "ViewController.h"#import @interface ViewController ()@property (weak, nonatomic) IBOutlet UIButton *buttonImg;@end@implementation ViewCon...
分类:
其他好文 时间:
2015-06-25 17:12:34
阅读次数:
146
关于连线拖出来的属性后面默认带叹号和为什么我们一开始不需要给它赋值问题
@IBOutlet
weak
var display:
UILabel!
因为系统自动帮你初始化了,display是一个optional,并且在使用之前就赋了nil.对于optional后面一般不是问号吗?但是对于实际类型而言它们没有什么区别.它仍然是一个option...
分类:
编程语言 时间:
2015-06-25 14:09:47
阅读次数:
1148
模型对象归档 1 import UIKit 2 3 class ViewController: UIViewController { 4 5 6 7 @IBOutlet weak var textField: UITextField! 8 9 @IB...
分类:
移动开发 时间:
2015-06-24 23:53:04
阅读次数:
256
通用文件存储 1 import UIKit 2 3 class ViewController: UIViewController { 4 5 @IBOutlet weak var textField: UITextField! 6 7 @IBAction func bt...
分类:
移动开发 时间:
2015-06-24 23:44:52
阅读次数:
262
闭包定义闭包参数闭包返回值闭包简化 - 尾随闭包闭包的循环引用weak var weakSelf = selfdemo("zhangsan") { (_) -> Int in println(weakSelf?.view.backgroundColor) return 20}
分类:
其他好文 时间:
2015-06-24 23:44:20
阅读次数:
168
在iOS的开发过程中,使用块的地方很多也很方便,但是在使用块的过程中要注意内存泄露的问题。 在块创建的时候,会对块内的所有对象的引用计数加一,直到块销毁,所以在使用块的过程中需要我们进行处理,在这里以AFNetworking的代码举例,代码如下: __weak __typeof(self)w...
分类:
其他好文 时间:
2015-06-23 19:53:29
阅读次数:
87
父类指针可以指向子类对象//定义block别名。typedef void (^LYItemOption)(); @interface LYItemArrow : LYItem@property(nonatomic,strong) Class desController;@property(nonat...
分类:
移动开发 时间:
2015-06-23 14:59:17
阅读次数:
146
以下代码中有Xcode中常见的3种注释/**
* 阴影 注释(1)这种注释在饮用cover时会出现在解释中
*/
@property (weak,nonatomic) IBOutlet UIButton *cover;
/**
* 控制状态栏的样式
* 注释(2)
* @return UIStatusBarStyleLightContent
*/
5. (UIStatusB...
分类:
其他好文 时间:
2015-06-22 06:29:48
阅读次数:
134
#pragma mark -- 循环引用 //----------------------------------------------------------------------------------------------------
/*
某些block中,使用self会造成循环引用
__weak AppDelegate *weakSel...
分类:
其他好文 时间:
2015-06-18 13:43:04
阅读次数:
164