diff --git a/source/chapter2/09_Classes_and_Structures.md b/source/chapter2/09_Classes_and_Structures.md index 74bff443..9f3d9e65 100755 --- a/source/chapter2/09_Classes_and_Structures.md +++ b/source/chapter2/09_Classes_and_Structures.md @@ -103,7 +103,7 @@ println("The width of someResolution is \(someResolution.width)") 在上面的例子中,`someResolution.width`引用`someResolution`的`width`属性,返回`width`的初始值`0`。 -你也可以访问子属性,如何`VideoMode`中`Resolution`属性的`width`属性: +你也可以访问子属性,如`VideoMode`中`Resolution`属性的`width`属性: ```swift println("The width of someVideoMode is \(someVideoMode.resolution.width)") @@ -126,7 +126,7 @@ println("The width of someVideoMode is now \(someVideoMode.resolution.width)") 所有结构体都有一个自动生成的成员逐一构造器,用于初始化新结构体实例中成员的属性。新实例中各个属性的初始值可以通过属性的名称传递到成员逐一构造器之中: ```swift -let vga = resolution(width:640, height: 480) +let vga = Resolution(width:640, height: 480) ``` 与结构体不同,类实例没有默认的成员逐一构造器。[构造过程](14_Initialization.html)章节会对构造器进行更详细的讨论。