值类型和引用类型
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
添加自定义大头针,使用系统大头针View#import "ViewController.h"#import #import "MyAnnotation.h"@interface ViewController () // 显示地图的View@property (weak, nonatomic) IBO...
分类:
其他好文 时间:
2015-03-17 17:35:06
阅读次数:
142
ios中使用ARC后,内存管理使用了新的关键字:strong(强引用) 和 weak(弱引用),默认是strong引用 strong: 使用strong类型指针指向的对象,会一直保持指向,直到所有strong类型指针全部释放,此对象才被销毁 weak: 一个对象只要没有strong...
分类:
其他好文 时间:
2015-03-17 11:58:29
阅读次数:
116
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
1 Strong and Weak#import "Person.h"@implementation Person- (void)dealloc{ NSLog(@"person destroy");}@end强指针:strong系统一般不会自动释放弱指针:weak 系统会立即释放对象//// ...
分类:
其他好文 时间:
2015-03-16 20:49:40
阅读次数:
179