Chapter 10 UINavigationController

1. When your application presents multiple screens of information, a UINavigationController maintains a stack of those screens. Each screen is the view of a UIViewController, and the stack is an array of view controllers. When a UIViewController is on top of the stack, its view is visible.

2. The viewControllers array of a navigation controller is dynamic - you start with a root view controller and push view controllers depending on user input, when the stack is popped, the controller is destroyed.  pushViewController:animated:

3. When the message endEditing: is sent to a view, if it or any of its subviews is currently the first responder, it will resign its first responder status, and the keyboard will be dismissed. (The argument passed determines whether the first responder should be forced into retirement. Some first responders might refuse to resign, and passing YES ignores that refusal.)

4. Like UINavigationItem, UIBarButtonItem is not a subclass of UIView. Instead, UINavigationItem encapsulates information that UINavigationBar uses to configure itself. Similarly, UIBarButtonItem is not a view, but holds the information about how a single button on the UINavigationBar should be displayed. (A UIToolBar also uses instances of UIBarButtonItem to configure itself.)

5. UIViewController has an editButtonItem property, and when sent editButtonItem, the view controller creates a UIBarButtonItem with the title Edit. Even better, this button comes with a target-action pair: it sends the message setEditing:animated: to its UIViewController when tapped.

6. Dismiss keyboard  with UIResponder’s method:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

[self.view endEditing:YES];

}

时间: 2024-10-09 00:56:39

Chapter 10 UINavigationController的相关文章

零元学Expression Blend 4 - Chapter 10 用实例了解布局容器系列-「StackPanel」

原文:零元学Expression Blend 4 - Chapter 10 用实例了解布局容器系列-「StackPanel」 本系列将教大家以实做案例认识Blend 4 的布局容器,此章介绍的布局容器是Blend 4 里的乖宝宝-「StackPanel」:及加码赠送「ScrollViewer」的运用. 本系列将教大家以实做案例认识Blend 4 的布局容器,此章介绍的布局容器是Blend 4 里的乖宝宝-「StackPanel」:及加码赠送「ScrollViewer」的运用. 就是要让不会的新手

Python Chapter 10: 列表 Part3

10.10 查找列表 )线性查找 线性查找顺序地将关键字key与列表中的每一个元素进行比较,直到找到某个匹配元素时返回其下标,亦或在找不到时返回-1.代码如下: # The function for finding a key in a list def linearSearch(lst, key): for i in range(len(lst)): if lst[i] == key: return i return -1 若关键字存在,线性查找在找到关键字前平均需要查找一半的元素,其运行时间

Cpp Chapter 10: Objects and Classes Part2

10.2.4 Using classes Following exapmle uses the class definition and implementation written in previous files: // usestok0.cpp -- the client program // compiler with stock00.cpp #include <iostream> #include "stock00.h" int main() { Stock s

Thinking in Java from Chapter 10

From Thinking in Java 4th Edition 内部类 public class Parcel1 { class Contents { private int i = 11; public int value { return i;} } class Destination { private String label; Destination(String whereTo) { label = whereTo; } String readLabel() { return l

C++ chapter 10——模板

**模板的概念 函数模板 类模板 名空间** 一.模板的概念 C++的模板提供对逻辑结构相同的数据对象通用行为的定义.模板运算对象的类型不是实际的数据类型,而是一种参数化的类型. 一个带类型参数的函数称为函数模板,一个带类型参数的类称为类模板. 二.函数模板 1.函数模板的概念 函数模板的基本原理是通过数据类型的参数化,将一组算法相同但所处理数据类型不同的重载函数凝练成一个函数模板.编译时,再由编译器按照函数模板自动生成针对不同数据类型的重载函数定义代码. 使用函数模板.对于函数模板,数据类型本

BDA chapter 10

numerical integration, 数值积分.numerical integration refers to methods in which the integral over continuous function is evaluated by computing the value of the function at finite number of points. Numerical integration methods can be divided to simulat

Head first java chapter 10 数字与静态

注意,先输出静态定义,然后运行main,输出"in main",然后statictests继承自staticsuper,所以先实现staticsuper,然后再实现statictests.

Chapter 10 Networking/JSON Services

<1>JSON Service In the previous section, you learned how to consume XML web services by using HTTP to connect to the web server and then obtain the results in XML. You also learned how to use DOM to parse the result of the XML document. However, man

数据库 chapter 10 数据库恢复技术

第十章 数据库恢复技术 介绍事务的基本概念和事务的性质,讲解数据库系统遇到故障后进行恢复技术和方法. 事务是一系列的数据库操作,是数据库应用程序的基本逻辑单元,是一个不可分割的工作单位. 事务和程序是两个概念,一般来说,一个程序里面包含多个事务. 事务处理技术主要包括数据库恢复技术和并发控制技术. 事务具有四个特性:原子性(Atomicity).一致性(Consistency).隔离性(Isolation)和持续性(Durability),这四个特性简称为ACID特性. 原子性:事务时数据库的逻