IOS开发 - AppDelegate的代理方法
2015-08-20 11:56
666 查看
[size=medium][color=red]
1. Info.plist和pch文件的作用
2. UIApplication的常见使用
3. AppDelegate的代理方法
4. UIApplication , AppDelegate , UIWindow , UIViewController 的关系
5. IOS程序的完整启动过程
[/color][/size]
﹣AppDelegate的代理方法﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣我是分割线﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣
现阶段的移动操作设备都有个特点 , 一个应用程序运行的过程中, 很容易受到打扰, 比如一个来电或者锁屏等操作,会导致应用程序进入后台或者终止
当发生这种情况的时候 , 应用程序受到干扰时, 会产生一些系统事件, 这时UIApplication会通知它的delegate对象 , 让delegate代理这些系统事件
![](http://dl2.iteye.com/upload/attachment/0111/1057/cf58f6c7-d3e2-32e5-bb5b-0b6f4bb506b3.png)
模拟内存方法 : Hardware -> Simulate Memory Warning
1. Info.plist和pch文件的作用
2. UIApplication的常见使用
3. AppDelegate的代理方法
4. UIApplication , AppDelegate , UIWindow , UIViewController 的关系
5. IOS程序的完整启动过程
[/color][/size]
﹣AppDelegate的代理方法﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣我是分割线﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣﹣
现阶段的移动操作设备都有个特点 , 一个应用程序运行的过程中, 很容易受到打扰, 比如一个来电或者锁屏等操作,会导致应用程序进入后台或者终止
当发生这种情况的时候 , 应用程序受到干扰时, 会产生一些系统事件, 这时UIApplication会通知它的delegate对象 , 让delegate代理这些系统事件
/**
* 一般在这里保存应用的数据
*/
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"进入后台的时候会调用 -- applicationDidEnterBackground");
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
NSLog(@"从后台进入时调用该方法 -- applicationWillEnterForeground");
}
/**
* 一般在这里清除不需要的内存
*/
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
NSLog(@"内存警告的时候会调用 -- applicationDidReceiveMemoryWarning");
}
/**
* 在App启动完毕后,就会调用该方法
*/
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return YES;
}
![](http://dl2.iteye.com/upload/attachment/0111/1057/cf58f6c7-d3e2-32e5-bb5b-0b6f4bb506b3.png)
模拟内存方法 : Hardware -> Simulate Memory Warning
相关文章推荐
- iOS Appdelegate代理方法说明和触发条件
- ios 开发中 Appdelegate中得生命周期的方法
- iOS开发学习之UI篇2、AppDelegate.m文件中方法的主要功能
- Xcode中的main.m文件与AppDelegate中的代理方法简介---iOS基础篇
- iOS开发UI篇 -- 04011AppDelegate中方法详解1
- iOS开发UI篇 -- 04011AppDelegate中方法详解2
- iOS开发--AppDelegate文件下各方法的用法
- 一、IOS程序执行顺序、APPdelegate代理方法执行顺序、ViewController 生命周期
- 【iOS-开发】:delegate(委托、代理)模式的设置方法
- iOS开发笔记--代理方法
- iOS AppDelegate协议方法
- iOS开发-Delegate 代理 使用和注意事项
- iOS开发之Protocol (协议) 和delegate(代理)
- IOS开发:UIALertView的基本用法与UIAlertViewDelegate对对话框的事件处理方法
- IOS的AppDelegate方法中的事件触发调用
- IOS的AppDelegate方法中的事件触发调用
- iOS开发中 delegate和 block传值方法的比较
- IOS Project AppDelegate 代理
- iOS统一设置状态栏的样式,交给代理AppDelegate
- 【转】ios开发之AppDelegate