From e74c53f80ab23eb065fc87880bafb8b7ffa0783c Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 13 Jul 2014 16:53:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AC=94=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > 12880 -> 1280 --- source/chapter2/09_Classes_and_Structures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/chapter2/09_Classes_and_Structures.md b/source/chapter2/09_Classes_and_Structures.md index c4e8ba41..92367954 100755 --- a/source/chapter2/09_Classes_and_Structures.md +++ b/source/chapter2/09_Classes_and_Structures.md @@ -113,7 +113,7 @@ println("The width of someVideoMode is \(someVideoMode.resolution.width)") 你也可以使用点语法为属性变量赋值: ```swift -someVideoMode.resolution.width = 12880 +someVideoMode.resolution.width = 1280 println("The width of someVideoMode is now \(someVideoMode.resolution.width)") // 输出 "The width of someVideoMode is now 1280" ``` From b5f259331b4a37aa2067ecab8a7da192f5dc5eee Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 13 Jul 2014 21:18:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E5=88=AB?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/chapter2/10_Properties.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/chapter2/10_Properties.md b/source/chapter2/10_Properties.md index 71c59d0e..26fd4937 100755 --- a/source/chapter2/10_Properties.md +++ b/source/chapter2/10_Properties.md @@ -109,7 +109,7 @@ println(manager.importer.fileName) ### 存储属性和实例变量 -如果您有过 Objective-C 经验,应该知道Objective-C为类实例存储值和引提供两种方用。对于属性来说,也可以使用实例变量作为属性值的后端存储。 +如果您有过 Objective-C 经验,应该知道Objective-C为类实例存储值和引提供两种方法。对于属性来说,也可以使用实例变量作为属性值的后端存储。 Swift 编程语言中把这些理论统一用属性来实现。Swift 中的属性没有对应的实例变量,属性的后端存储也无法直接访问。这就避免了不同场景下访问方式的困扰,同时也将属性的定义简化成一个语句。 一个类型中属性的全部信息——包括命名、类型和内存管理特征——都在唯一一个地方(类型定义中)定义。