MainApp.m
资源名称:PushBox.rar [点击查看]
上传用户:qhdwjd2004
上传日期:2020-12-29
资源大小:362k
文件大小:2k
源码类别:
iPhone
开发平台:
Objective-C
- #import "MainApp.h"
- @implementation MainApp
- // 程序加载完毕
- - (void) applicationDidFinishLaunching: (id) unused
- {
- // Remove the top status bar
- [UIHardware _setStatusBarHeight:0];
- //[self setStatusBarMode:0 duration:0];
- [self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0];
- CGRect rect = [ UIHardware fullScreenApplicationContentRect];
- rect.origin.x = rect.origin.y = 0.0f;
- window = [[UIWindow alloc] initWithContentRect: rect];
- [ window orderFront: self ];
- [ window makeKey: self ];
- [ window _setHidden: NO ];
- mainView = [ [ MainView alloc ] initWithFrame: rect ];
- [ window setContentView: mainView ];
- }
- // 设备方向变化
- - (void)deviceOrientationChanged:(GSEvent *)event {
- [mainView orientationChanged:
- [ UIHardware deviceOrientation: YES ]];
- }
- // 屏幕锁定
- - (void)applicationWillSuspendUnderLock:(struct __GSEvent *)event
- {
- }
- // 被电话等事件中断
- - (void)applicationWillSuspendForEventsOnly:(struct __GSEvent *)event
- {
- }
- // home 按钮按下(及所有中断的最终处理)
- - (void)applicationSuspend:(struct __GSEvent *)event
- {
- [mainView appWillExit];
- [self terminate];
- }
- // 屏幕解锁
- - (void)applicationDidResumeFromUnderLock:(struct __GSEvent *)event
- {
- }
- // 从中断事件中恢复(接完电话)
- - (void)applicationDidResumeForEventsOnly:(struct __GSEvent *)event
- {
- }
- // 状态恢复(从所有中断中恢复)
- - (void)applicationDidResume:(struct __GSEvent *)event
- {
- }
- // 程序结束
- - (void)applicationWillTerminate
- {
- }
- @end