#import "YcanAppDelegate.h"
@implementation YcanAppDelegate
// 程序启动时调用
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@" didFinishLaunchingWithOptions ");
NSLog(@" 程序启动 ");
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];// 根据屏幕尺寸创建程序窗口
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];// window的背景设为白色
[self.window makeKeyAndVisible];// 使得winodw置于最前端并可见,对于编程者的区别就是在其前或者其后添加代码
return YES;
}
// 程序挂起时调用
- (void)applicationWillResignActive:(UIApplication *)application
{
NSLog(@" applicationWillResignActive ");
NSLog(@" 程序挂起 ");
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
// 程序进入后台运行
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSLog(@" applicationDidEnterBackground ");
NSLog(@" 程序进入后台 ");
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
// 程序进入前台运行
- (void)applicationWillEnterForeground:(UIApplication *)application
{
NSLog(@" applicationWillEnterForeground ");
NSLog(@" 程序进入前台 ");
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
// 程序激活时调用
- (void)applicationDidBecomeActive:(UIApplication *)application
{
NSLog(@" applicationDidBecomeActive ");
NSLog(@" 程序激活 ");
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
// 程序结束时调用
- (void)applicationWillTerminate:(UIApplication *)application
{
NSLog(@" applicationWillTerminate ");
NSLog(@" 程序结束 ");
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
应用程序托管代码分析
最新推荐文章于 2017-11-29 00:59:30 发布