Chapter 6 ViewController

1. A  view controller’s view is not created until it needs to appear on the screen  . This optimization is called lazy loading, and it can conserve memory and improve performance.

~ programmatically, by overriding the UIViewController method loadView.

~ in Interface Builder, by loading a NIB file.)

2. When  a view controller is created, its view property is nil, If a view controller is asked for its view and its view is nil, then  the view controller is sent the loadView message.

3. Setting a view controller as  the rootViewController adds that view controller’s view as a subview of the window (UIWindow’s setRootViewController:), It also automatically resizes the view to be the same size as the window.

4. When a view controller gets its view hierarchy by loading a NIB file, you do not override loadView.

5. UITabBarController allows user to swap between view controllers.

6. A local notification is a way for an application to alert the user even when the application is not currently running.

~ NSDate *date = [NSDate  date];

UILocalNotification *note = [[UILocalNotification alloc] init];

note.alertBody = @“Local notification”;

note.fireDate = date;

[[UIApplication shareApplication] scheduleLocalNotification:note];

时间: 2024-11-07 13:43:17

Chapter 6 ViewController的相关文章

ANSI Common Lisp Chapter 2

Chapter 2 总结 (Summary) Lisp 是一种交互式语言.如果你在顶层输入一个表达式, Lisp 会显示它的值. Lisp 程序由表达式组成.表达式可以是原子,或一个由操作符跟着零个或多个实参的列表.前序表示法代表操作符可以有任意数量的实参. Common Lisp 函数调用的求值规则: 依序对实参从左至右求值,接着把它们的值传入由操作符表示的函数. quote 操作符有自己的求值规则,它完封不动地返回实参. 除了一般的数据类型, Lisp 还有符号跟列表.由于 Lisp 程序是

iOS7新特性 ViewController转场切换(三) 自定义视图控制器容器的切换---非交互式

@继续前面的内容,这一章,主要介绍自定义ViewController容器上视图VC的切换.先来看看系统给我们提供的容器控制器 UINavigationController和UITabBarController 都有一个NSArray类型的属性viewControllers,很明显,存储的就是需要切换的视图VC.同理,我们定义一个ContainerViewController,是UIViewController的直接子类,用来作为容器依托,额,其他属性定义详见代码吧,这里不多说了.(PS:原先我进

Chapter 5 MySQL Server Administration_1

Chapter 5 MySQL Server Administration Table of Contents 5.1 The MySQL Server 5.1.1 Configuring the Server 5.1.2 Server Configuration Defaults 5.1.3 Server Option and Variable Reference 5.1.4 Server Command Options 5.1.5 Server System Variables 5.1.6

ViewController加载顺序与self.view

从Stroyboard和xib中加载的ViewController的不同点在于 1.从Storyboard加载的ViewController只调用initWithCoder:方法,从xib加载的ViewController调用的是先执行initWithNibName:方法,后执行init方法.如果使用initWithNibName:方法初始化,则不会执行init方法: 2.从Storyboard里加载的ViewController,不能在initWithCoder:里面写self.view,而从

Notes : <Hands-on ML with Sklearn & TF> Chapter 7

.caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordere

软工Chapter Six

软工Chapter six 团队和流程 典型的软件团队模式和开发流程是:主治医师模式.明星模式.社区模式.业余剧团模式.秘密团队.特工团队.交响乐团模式.爵士乐模式.功能团队模式:写了再改模式.瀑布模型.瀑布模型的各种变形.统一流程.老板驱动的流程.渐进交付的流程. 现在的编程离不开团队的合作,那么怎样的组合才能算是一个团队呢?首先,团队有一致的集体目标,团队要一起完成这目标.一个团队的成员不一定要同时工作,但一定要有共同的目标.另外团队成员有各自的分工,互相依赖合作,共同完成任务. 软件团队有

[AWDwR4] chapter 11 Play time 2th: use blind_up effect

chapter 11 Play time Play time 2:    使用Script.aculo.us JavaScript库中的blind_up效果代替隐藏cart这个div的过程.    上网搜了一下,jquery中有blind这个效果,所以就用jquery中的hide("blind"),而不使用Script.aculo.us JavaScript库    app/views/carts/destroy.js.erb这个文件可以有好几种写法,对照着可以加深理解:      

Professional C# 6 and .NET Core 1.0 - Chapter 41 ASP.NET MVC

What's In This Chapter? Features of ASP.NET MVC 6 Routing Creating Controllers Creating Views Validating User Inputs Using Filters Working with HTML and Tag Helpers Creating Data-Driven Web Applications Implementing Authentication and Authorization W

viewController的生命周期

ViewController是iOS开发中MVC模式中的C,ViewController是view的controller,ViewController的职责主要包括管理内部各个view的加载显示和卸载,同时负责与其他ViewController的通信和协调.在IOS中,有两类ViewController,一类是显示内容的,比如UIViewController.UITableViewController等,同时还可以自定义继承自UIViewController的ViewController:另一类