iOS 容器控制器 (Container View Controller) 一个控制器包含其他一个或多个控制器,前者为容器控制器 (Container View Controller),后者为子控制器 (Child View Controller).UINavigationController.UITabBarController 是常用的容器控制器.本文介绍自定义容器控制器的方法. 自定义容器控制器 添加子控制器 - (void)displayContentController:(UIView…
近期使用Container View来在主View Controller建立自己的子Controller,但是遇到问题.不知道怎样用代码获取Controller View附带的View Controller. 本想获取了其附带的View Controller,在里面设置代理.然后再主View Controller中实现代理方法,找了非常多资料,解决方式例如以下. 建立一个.h与.m文件,使其关联Container view附带的View Controller,在里面设置代理. 点击Segue,设…
一.UIViewController 做iOS开发的经常会和UIViewController打交道,从类名可知UIViewController属于MVC模型中的C(Controller),说的更具体点它是一个视图控制器,管理着一个视图(view). UIViewController的view是lazy loading的,当你访问其view属性的时候,view会从xib文件载入或者通过代码创建(覆盖loadView方法,自定义其view hierarchy),并返回,如果要判断一个View Con…
一.ViewController的职责 对内管理与之关联的View,对外跟其他ViewController通信和协调.对于与之关联的View,ViewController总是在需要的时候才加载视图,并在不需要的时候卸载视图,所以也同时担当了管理应用资源的责任 二.ViewController的生命周期 View是指Controller的View.它作为Controler的属性,生命周期在Controller的生命周期内.就是说你的Controller不能在view释放前就释放了. viewCon…
Views Because view objects are the main way your application interacts with the user, they have many responsibilities. Here are just a few: 因为视图对象是应用程序跟用户交互的主要方式,所以它们有很多责任.以下是其中一小部分: Layout and subview management 布局和子视图管理 A view defines its own defau…
Windows Every iOS application needs at least one window—an instance of the UIWindow class—and some may include more than one window. A window object has several responsibilities: 每个iOS应用程序需要至少一个窗口---UIWindow类的一个实例---有些可能有不止一个窗口.窗口对象的任务是: It contains…
View and Window Architecture 视图和窗口架构 Views and windows present your application’s user interface and handle the interactions with that interface. UIKit and other system frameworks provide a number of views that you can use as-is with little or no mod…
在 IOS 开发当中经常碰到 whose view is not in the window hierarchy 的错误,该错误简单的说,是由于 "ViewController" 还没有被加载,就调用该 ViewController 或者 ViewController 内的方法时,就会报这个错误.   在不同地方调用 ViewController,解决的方法也不太一样.     1. 在 一个 ViewController 里面调用另外一个 ViewController 是出现这个错误…
参考:http://www.cnblogs.com/patientAndPersist/p/3279645.html Using View Controllers in Your App Whether you are working with view controllers provided by iOS, or with custom controllers you’ve created to show your app’s content, you use a similar set o…
Table View简单描述: 在iPhone和其他iOS的很多程序中都会看到Table View的出现,除了一般的表格资料展示之外,设置的属性资料往往也用到Table View,Table View主要分为以下两种: Plain:这是普通的列表风格 Grouped :这是分块风格.   对于UITableView,我們有一些特殊的概念和术语,比如说我们成Table View的一行为Cell,而许多的Cell可以组成Section,每个Section上下又分別有Header和Footer,许多个…