码迷,mamicode.com
首页 > 其他好文 > 详细

Chapter 6 ViewController

时间:2014-09-16 18:50:10      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:io   ar   for   sp   on   c   ad   size   r   

 

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];

 

Chapter 6 ViewController

标签:io   ar   for   sp   on   c   ad   size   r   

原文地址:http://www.cnblogs.com/1oo1/p/3975467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!