Skip to content

Commit 9cb6f59

Browse files
authored
Merge Some Part of Episode 7 from @smilexyk
2 parents de61019 + 3bc64aa commit 9cb6f59

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

subtitles/7. Multiple MVCs, Timer, and Animation.srt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,87 +16,108 @@ welcome to Lecture number 7, Stanford CS193P, Fall 2017. So
1616
4
1717
00:00:14,080 --> 00:00:19,351
1818
our primary topic today is combining MVCs to make bigger,
19+
今天,我们的主要任务显然就是将多个 MVC 组合成组件更多,
1920

2021
5
2122
00:00:19,420 --> 00:00:22,153
2223
more powerful applications, obviously. And
24+
功能更强大的应用程序。
2325

2426
6
2527
00:00:22,222 --> 00:00:24,890
2628
then I'm gonna do a big demo that shows you how to do that.
29+
同时,我也将示范编写一个更大的样例程序来向你们展示该如何完成这项工作。
2730

2831
7
2932
00:00:24,959 --> 00:00:27,559
3033
We're gonna do it with Concentration, we're gonna add
34+
本次的示范将以 Concentration 这个 app 为基础,我们将来要向其添加
3135

3236
8
3337
00:00:27,627 --> 00:00:30,929
3438
an MVC into that app. Then I'll come back to the slides,
39+
一个 MVC。然后我会回到幻灯片上,
3540

3641
9
3742
00:00:30,998 --> 00:00:33,865
3843
and talk I'll about timer and choose classes, some of you
44+
(这里疑似all about)我会讲授有关计时器和选择类的相关内容,
3945

4046
10
4147
00:00:33,934 --> 00:00:37,169
4248
used in the extra credit of the homework assignments. And
49+
这部分内容你们可能会在作业的选做部分需要用到。
4350

4451
11
4552
00:00:37,237 --> 00:00:39,004
4653
then I'm gonna dive into the next topic and try and
54+
然后的时间我会尽可能深入讲解下一个主题,也就是动画部分,
4755

4856
12
4957
00:00:39,073 --> 00:00:41,373
5058
get as far as I can which is animation.
59+
能讲多少讲多少。
5160

5261
13
5362
00:00:41,442 --> 00:00:43,275
5463
Which will be our topic on Wednesday and
64+
这也将是我们在周三的课程上的主要内容,
5565

5666
14
5767
00:00:43,343 --> 00:00:45,376
5868
I'll get to much more detail, do a big demo.
69+
并且我会更深入地讲解更多细节性内容,做一个更大的示范程序。
5970

6071
15
6172
00:00:45,445 --> 00:00:47,512
6273
But I wanna kinda get in as far as I can today just so
74+
我今天会尽可能地讲解理论部分的内容,
6375

6476
16
6577
00:00:47,581 --> 00:00:50,916
6678
we have more time for a demo on Wednesday.
79+
这样我们周三上课时就会有足够的时间进行操作示范。
6780

6881
17
6982
00:00:50,984 --> 00:00:54,486
7083
Alright so combining MVCs, remember this slide from when
84+
回到整合 MVC 上来,还记得我们讲解 MVC 时使用的这张幻灯片吗?
7185

7286
18
7387
00:00:54,555 --> 00:00:58,190
7488
I talked about MVC. This is the MVCs working together, and
89+
这就是多个 MVCs 协同工作的示意图,
7590

7691
19
7792
00:00:58,259 --> 00:01:01,193
7893
we saw that when we have MVCs working together,
94+
我们可以看到,当多个 MVCs 协同工作时,
7995

8096
20
8197
00:01:01,261 --> 00:01:04,862
8298
these other MVCs. Let me get my thing under control here,
99+
其他的 MVC……(此处幻灯片动画出错)让我把它修好……
83100

84101
21
85102
00:01:04,931 --> 00:01:08,967
86103
well, can't do it. Okay, these other MVCs down in the corner,
104+
好吧,它彻底坏掉了。其他的角落里的 MVCs
87105

88106
22
89107
00:01:09,036 --> 00:01:12,170
90108
they serve as part of the view of another MVC. That's
109+
他们通过控制其他 MVC 中的一个 view,来为整个 app 服务。
91110

92111
23
93112
00:01:12,239 --> 00:01:16,608
94113
the way MVC's relate. An MVC is a view, part of a view
114+
这就是 MVC 之间相互联系的方法。一个 MVC 就是一个 view,同时也是其他类中的 view 的一部分。
95115

96116
24
97117
00:01:16,677 --> 00:01:19,811
98118
of another class. And that has some ramifications for MVC,
99119

120+
100121
25
101122
00:01:19,880 --> 00:01:22,781
102123
most notably it has to have blind structured communication
@@ -1141,65 +1162,81 @@ which is often nice to have a title of your master of
11411162
00:14:10,183 --> 00:14:13,517
11421163
your split view. Now you can- One thing to notice about this
11431164

1165+
11441166
286
11451167
00:14:13,586 --> 00:14:16,420
11461168
of course, is that now the master of your split view is
1169+
现在你的 Split View 的主视图控制器不再是 Calculator 了,
11471170

11481171
287
11491172
00:14:16,489 --> 00:14:19,757
11501173
no longer the calculator, it's a navigationController.
1174+
而是一个 navigationController。
11511175

11521176
288
11531177
00:14:19,826 --> 00:14:21,492
11541178
So if you actually wanted to get out the calculator,
1179+
如果你确实想要获取到 calculator,
11551180

11561181
289
11571182
00:14:21,561 --> 00:14:23,394
11581183
you would have to get the master and
1184+
你必须先获取到主视图控制器,
11591185

11601186
290
11611187
00:14:23,463 --> 00:14:27,465
11621188
then look at the master's rootViewController to find
1189+
然后找到它的 rootViewController,
11631190

11641191
291
11651192
00:14:27,533 --> 00:14:29,901
11661193
the calculator there.
1194+
你要找的 calculator 在那里。
11671195

11681196
292
11691197
00:14:29,969 --> 00:14:32,469
11701198
By the way, you can also put the detail, wrap it in
1199+
另外,你也可以把你的细节视图控制器放在一个 navigationController 中
11711200

11721201
293
11731202
00:14:32,538 --> 00:14:34,839
11741203
a navigationController. The only reason you would ever
1204+
你想做这件事,唯一的原因就是
11751205

11761206
294
11771207
00:14:34,908 --> 00:14:37,908
11781208
want to do that is to give it a title bar, cuz you don't,
1209+
想给它一个标题栏。
11791210

11801211
295
11811212
00:14:37,977 --> 00:14:40,445
11821213
you always navigate from the master, that's why it's called
1214+
你总是从主视图控制器导入的,这也是他被称为“主”的原因。
11831215

11841216
296
11851217
00:14:40,513 --> 00:14:43,313
11861218
the master. So you can do it, but again if you do that,
1219+
所以你可以这么做,不过再一次,如果你这么做的话
11871220

11881221
297
11891222
00:14:43,382 --> 00:14:45,716
11901223
make sure when you look at the detail, if you find that
1224+
确保当你关注 detail 的时候,
11911225

11921226
298
11931227
00:14:45,784 --> 00:14:48,652
11941228
it's a navigationController, you need to look inside and
1229+
如果你发现他是一个 navigationController,你就需要向里看,
11951230

11961231
299
11971232
00:14:48,721 --> 00:14:51,488
11981233
see the thing that's inside of it, the rootViewController.
1234+
找到它内部的视图控制器,rootViewController。
11991235

12001236
300
12011237
00:14:51,557 --> 00:14:53,223
12021238
Or you can also use visibleViewController
1239+
或者你也可以用 visibleViewController
12031240

12041241
301
12051242
00:14:53,292 --> 00:14:54,392

0 commit comments

Comments
 (0)