[Stanford 2011] segue

From:view 6(00:17)

Knowledge Points:

1. The segue is the thing that made it so that it moved over to the other MVC.

2. How the segue gets set up?

To create a segue,you hold down ctrl and drag from the button to the other View Controller.

Segues always instantiate a view controller.You never segue to an existing view controller,one that‘s already sitting in the heap. Segues create a new view controller,always. And they do this because, thatis the model we want for memory management. We want MVCs to get created when they go on screen. And then when they go off-screen, unless there‘s back button that might go to them,they go away. And then if you were to press the graph button again they get recreated, so view controllers are somewhat ephemeral alright. They come into existence they‘re used on screen, and when they go off screen a lot of times they‘ll just go away. And that keeps the memory usage for our app low.

two important properties are (1)The identifier. That gives a name to this segue.And the reasons we want the name:One, in our code we can say, go do this segue,by name. Specify the name of a segue, it‘ll go do it. And also, when segues happen, we get to get involved, maybe preparing this newly created view controller beyond screen. And we identify what to do to prepare it by the name,the segue. So it‘s important to know the name of this segue.(2)The style. There‘s different styles of segues. "push style" means it‘s in a navigation controller.

3. How we create a UINavigationController in our storyboard(putting the segue into the navigationController)?

We‘ve defined the segue between them, then we should put them inside navigation controller.

Tip: If you double click on the background of your storyboard, it‘ll zoom out to show you more. Which you really need when you start building your whole app, and multiple MVCs, all segueing into each other. You wanna be able to see the whole thing, and so you can zoom out. You can also zoom out with these little things down on the bottom.

The arrow that‘s going into that view controller means that this is where the application starts. You can pick that arrow up with the mouse in Xcode to move it to another control. Or you can use a little switch in the Inspector in the right side. That says initial scene.

How we get this thing in navigation controller?  ans:  Xcode | Editor | Embed in | Navigation Controller, so another view controller‘s going to appear, a navigation controller. Notice that it‘s going to keep the arrow, it moves the arrow to itself. and Then it has a little pointer right after it,which is not a segue. This little pointer in between is a special little connection in Xcode, which is the rootViewController outlet of the UINavigationController. (The navigation controller have a pointer to the root view controller that‘s the first MVC that they display. So that‘s what the little thing is. )

UINavigationController is as bellow:

时间: 2024-12-25 00:13:57

[Stanford 2011] segue的相关文章

[Stanford 2011] Psychologist

From: view 6(00:44-) 1. Our psychologist will make a diagnosis and use the Happiness MVC to communicate it. Psychologist really has no Model(perhaps its"diagnosis",but it doesn't store it anywhere). Some MVCs are just for presenting user-interfa

[Stanford 2011] UIView、协议、手势识别

1.Autorotation 自动旋转时controller发生了什么?一是controller的view在controller允许的时候调整frame,方法shouldAutorotateToInterfaceOrientation返回controller是否允许view自动根据设备旋转而旋转.自动旋转接口包括竖直.上下颠倒.左横向和右横向这4种情况.只要在controller里实现这个方法就ok.   不管支持的是哪个方向,旋转的时候view的bound会改变,子view的frame会变,子

[Stanford 2011] hapiness

From:view6-view7(00:17) 1.Introduction: Implement two gestures:pinch and pan. We first implement the pinch. We add delegate to faceView(the view) that allowed faceView to get the data,which is the degree(-1 to 1) of the smile face. Then the Controlle

Stanford iOS Learn Notes - 8

好久没有写笔记了.这二十天好忙啊,项目要发布,没有太多的时间看iOS了. 现在已经把Stanford的教程学完了,但是感觉很尴尬.其实看代码的时候,感觉没一个Demo都没有什么东西,但是看Demo看时似是而非的看不懂.视频里面,教授用每个API都是信手拈来,但是自己去写,课后看代码的时候,就不是那么回事了.不同的地方改用什么对象,UILable还是UIButton?这个对象都有什么API?这些其实都不知道.而要成为熟练的iOS开发者,这些其实是非常非常重要的. 翻了之前的几遍笔记主要是写了API

stanford推荐阅读目录

stanford推荐阅读目录 stanford deep learning 网站上推荐的阅读目录: UFLDL Recommended Readings If you're learning about UFLDL (Unsupervised Feature Learning and Deep Learning), here is a list of papers to consider reading. We're assuming you're already familiar with b

2011斯坦福大学iOS应用开发教程学习笔记(第一课)MVC.and.Introduction.to.Objective-C

2011年冬季斯坦福大学公开课 iOS应用开发教程是个很经典的教程,这个老头讲的很给力.做笔记总结. 第一课名称: MVC and Introduction to Objective-C 这课的主要内容有: iOS的概述  -什么是iOS MVC - 面向对象的概念 Objective-C-介绍下语言的概念 iOS包括四层 内核 内核是mach 4.x BSD UNIX内核 mac OS  10操作系统,是个多任务的UNIX内核,在这层上提供了网络,socket ,安全机制,文件系统,大部分这些

BZOJ2440 [中山市选2011]完全平方数

Description 小 X 自幼就很喜欢数.但奇怪的是,他十分讨厌完全平方数.他觉得这些数看起来很令人难受.由此,他也讨厌所有是完全平方数的正整数倍的数.然而这丝毫不影响他对其他数的热爱. 这天是小X的生日,小 W 想送一个数给他作为生日礼物.当然他不能送一个小X讨厌的数.他列出了所有小X不讨厌的数,然后选取了第 K个数送给了小X.小X很开心地收下了. 然而现在小 W 却记不起送给小X的是哪个数了.你能帮他一下吗? Input 包含多组测试数据.文件第一行有一个整数 T,表示测试数据的组数.

【Xamarin 开发 IOS --使用 Storyboard Segue 实作 UIViewController 的切换 (实例)】

注意:在vs2015中进行画板之间的导航的时候,使用CTRL+鼠标左键进行导航的设定. 使用 NavigationController 进行 画板的链接.... 使用 Storyboard Segue 实作 UIViewController 的切换 (实例) 博客分类: Phone / IOS / Objective-C / Swift Storyboard 是在 iOS 5 SDK 中才出现的新名词,它其实就是原本的 Xib 档案(Interface Builder),用来制作介面排版方面的工

开始使用CCA CRM 2011

你可能从微软的市场动态获知我们最近发布了最新版本的Microsoft Dynamics CRM 2011的客户关怀加速器(CCA R2).CCA在一个单一的用户界面提供呼叫中心功能相结合的,能够显示和操纵来自不同业务应用程序的数据.CCA提供了许多功能,包括: l 集成代理的桌面 l 脚本以消除重复的数据输入 l 计算机电话集成(CTI) l 代理活动报告 CCA的核心是一个允许开发人员构建自己的代理的桌面,并提供多会话管理等功能的框架.UI集成不同类型的应用程序(包括Web.Windows窗体