iOS5.0以后就开始可以使用ARC(Automatic Reference Counting:自动引用计数)来代替之前的MRC(Manual Reference Counting:人工引用计数)。使用ARC会减少很多代码和忘了释放对象的苦恼。但是事情都有两面性。使用了ARC之后如果你想复用以前写过...
分类:
其他好文 时间:
2015-03-19 21:50:30
阅读次数:
143
可以从不同的的角度去划分垃圾回收算法:按照基本回收策略分引用计数(Reference Counting):比较古老的回收算法。原理是此对象有一个引用,即增加一个计数,删除一个引用则减少一个计数。垃圾回收时,只用收集计数为0的对象。此算法最致命的是无法处理循环引用的问题。标记-清除(Mark-Swee...
分类:
编程语言 时间:
2015-03-19 21:47:01
阅读次数:
187
值类型和引用类型
import UIKit
func tryToChangeValue( var x:Int ){x++}
var a:Int = 2
tyrChangeValue(a)
a
var b:Int = a
b
b++
b
a
Value Type and Reference Type
Int,Float,Double,Bool
...
分类:
其他好文 时间:
2015-03-19 11:36:21
阅读次数:
109
1 const对象默认为文件的局部变量(P50)a.cppconst int a = 1;b.cppextern int a;//undefined reference to "a"a.cppint a = 1;b.cppextern int a;//OKa.cppextern const int ...
分类:
编程语言 时间:
2015-03-18 15:41:29
阅读次数:
202
Reference Link:http://www.yjbys.com/bbs/326026.htmlconst关键字用来声明编译时常量,readonly用来声明运行时常量密封类不能同时为抽象类可以覆写私有的虚方法吗? 答:不可以,甚至子类中无法访问父类中的私有方法base 表示当前对象基类的实例(...
分类:
Web程序 时间:
2015-03-18 00:57:52
阅读次数:
165
使用gcc编译C代码,引用了C++ 库,出现这个错误,网上搜到这哥们的文章,解决问题转自:错误:undefined reference to `__gxx_personality_v0'1. Linux Develop Notes * 编译 c++ 程序需要添加 -lstdc++ sample: g...
分类:
其他好文 时间:
2015-03-17 19:39:13
阅读次数:
109
As you know from "Introducing Metro," the reference implementations of the JAXB 2.x data-binding and JAX-WS 2.x Web services standards are at the core...
分类:
编程语言 时间:
2015-03-17 00:23:47
阅读次数:
300
http://blog.csdn.net/fengsh998/article/details/8691823API接口文档。https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CoreText_Framewo...
分类:
其他好文 时间:
2015-03-16 17:43:46
阅读次数:
113
学习过JDK 8的都知道,在JDK 8中两个重要的特性就是Lambda Expression和Stream API.Lambda Expression可以使用在任何需要函数式接口的地方。(只包含一个抽象方法的接口,在JDK 8中,接口可以有默认实现)而为了进一步简化Lambda Expression...
分类:
其他好文 时间:
2015-03-16 14:12:59
阅读次数:
111