UIApplication简介


From the time your app is launched by the user, to the time it exits, the UIKit framework manages much of the app’s core behavior. At the heart of the app is the UIApplication object, which receives events from the system and dispatches them to your custom code for handling. Other UIKit classes play a part in managing your app’s behavior too, and all of these classes have similar ways of calling your custom code to handle the details.

You use the UIApplication object essentially as is—that is, without subclassing. This controller object manages the app event loop and coordinates other high-level app behaviors. Your own custom app-level logic resides in your app delegate object, which works in tandem with this object.

描述:

该UIApplication类提供了一个内部监督办公室的协调运行的应用程序的集中控制点。

每个应用程序必须有且只有一个实例UIApplication (或子类UIApplication )。

当应用程序启动时, UIApplicationMain函数被调用;除其他任务,该函数创建一个单UIApplication对象。

此后,您可以访问这个对象调用由sharedApplication类的方法。

一个重要的角色UIApplication的目的是处理事件的初期路由传入的用户。

这还调度对象(行动控制消息转发给它UIControl )到适当的目标对象。

此外, UIApplication对象维护一个窗口列出所有的( UIWindow对象)当前打开的应用程序,因此它可以通过这些检索的任何应用程序UIView对象。

应用程序对象通常被分配一个代表,一个对象,应用程序运行时事件通知重要,例如,应用程序启动,低内存警告,和应用程序终止,给它一个机会,作出适当的反应。

应用程序可以通过一个协同处理资源,如电子邮件的图像文件或openURL:方法。

例如,一个应用程序打开一个与这个方法的电子邮件网址可能导致邮件客户端启动并显示消息。

sharedApplication

返回的单身应用程序实例。

+ (UIApplication *)sharedApplication

cancelAllLocalNotifications

取消所有预定当地通知交货。

- (void)cancelAllLocalNotifications

cancelLocalNotification:

取消指定的当地通知传递计划。

- (void)cancelLocalNotification:( UILocalNotification *) notification

canOpenURL:

返回应用程序是否可以打开一个给定的URL资源。

- (BOOL)canOpenURL:( NSURL *) url

registerForRemoteNotificationTypes:

注册以接收来自苹果供应商通过指定类型的通知推送服务。

- (void)registerForRemoteNotificationTypes:(types)

类型
一个位掩码指明通知的应用程序接受的类型。

setStatusBarHidden:withAnimation:

隐藏或显示状态栏,选择动画过渡。

- (void)setStatusBarHidden:(BOOL) hidden withAnimation:(( UIStatusBarAnimation ) animation )

Parameters参数
hidden 隐藏
YES隐藏状态栏, NO以显示状态栏。
withAnimation 动画
一个常数,指示是否应该有一个动画,如果一个请求时,是否应该淡入或淡出的状态栏或是否应该幻灯片或缩小状态栏。

setStatusBarOrientation:animated:

设置应用程序的状态栏到指定的方向,可选择动画过渡。

- (void)setStatusBarOrientation:( UIInterfaceOrientation ) interfaceOrientation animated:(BOOL) animated

Parameters参数
一个状态栏的具体方向。.默认值是UIInterfaceOrientationPortrait 。
animated 动画
YES ,如果过渡到新的方向应该是动画, NO是否应立即动画,没有。

unregisterForRemoteNotifications

从苹果公司收到注销通知推送服务。

- (void)unregisterForRemoteNotifications

UIInterfaceOrientation

该应用程序的用户界面的方向。

typedef enum {
UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait ,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown ,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight ,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;

UIStatusBarStyle

该设备的状态栏的风格。

typedef enum {
UIStatusBarStyleDefault ,
UIStatusBarStyleBlackTranslucent ,
UIStatusBarStyleBlackOpaque
} UIStatusBarStyle

UIStatusBarAnimation

该动画应用到状态栏,因为它是隐藏或可见。

typedef enum {枚举类型定义{
    UIStatusBarAnimationNone ,
    UIStatusBarAnimationFade ,
    UIStatusBarAnimationSlide ,
} UIStatusBarAnimation;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值