#import "ViewController.h"
@interface ViewController ()
@property(nonatomic,weak)UIWebView* web;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
...
分类:
Web程序 时间:
2015-06-26 12:57:46
阅读次数:
157
使用 weak–strong dance 技术block 可以直接引用 self,但是要非常小心地在 block 中引用 self。因为在 block 引用 self,可能会导致循环引用。如下例所示:[objc] view plaincopy@interfaceKSViewController(){...
分类:
其他好文 时间:
2015-06-26 12:35:37
阅读次数:
164
必须返回对象时,别妄想返回其reference我们上节分析了对象引用传递的好处,现在说明函数返回引用对象带来的种种坏处。
先来一段代码:class Rational{
public:
Rational(int numerator=0, int denominator=1);
……
private:
int n, d;
friend
const Rationa...
分类:
编程语言 时间:
2015-06-26 11:04:44
阅读次数:
105
本文的主要内容:ARC的本质ARC的开启与关闭ARC的修饰符ARC与BlockARC与Toll-Free BridgingARC的本质ARC是编译器(时)特性,而不是运行时特性,更不是垃圾回收器(GC)。Automatic Reference Counting (ARC) is a compiler...
分类:
移动开发 时间:
2015-06-26 10:56:25
阅读次数:
219
转: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
宁以pass-by-reference-to-const替换pass-by-value本节,我们一起来探究一下值传递和引用传递之间的区别。
先看一段代码:class Person{
public:
Person();
virtual ~Person();
……
private:
std::string name;
std::string address;
}...
分类:
编程语言 时间:
2015-06-26 09:16:40
阅读次数:
110
自动布局#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
原文地址:http://projectreactor.io/docs/reference/Reactor简介Reactor是一个基础库,用在构建实时数据流应用、要求有容错和低延迟至毫秒、纳秒、皮秒的服务。— PrefaceTL;DR什么是Reactor? 让我们大致了解一下Reactor。在你使用....
分类:
其他好文 时间:
2015-06-25 13:54:40
阅读次数:
219
模型对象归档 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